We recently ran into an issue when testing Rubi on older versions. It boils down to this simple example which I didn't dare to simplify further as I cannot test it in versions < 10
Test[XXX[expr_, x_], n_Integer : Infinity, OptionsPattern[]] := True /;
Head[x] === Symbol && n > 0;
Test[___] := False;
XXX[blub, x] // Test
The important part is n in the pattern and it should say
nis an integernis optional anInfinityper defaultnmust be greater zero
Above code gives False in versions 8 and 9, but True in version 10 and 11. I'm not looking for a workaround, but I'd like to understand why it returns False in the older versions.
Maybe someone who still has access can give me some insight.
Infinitydoes not have the headInteger. I believe they relaxed the pattern matcher in M10 to allow such patterns. – Carl Woll Aug 18 '18 at 08:20f[x_Integer: "Error"] := x; f[]returns "Error" although it also has not theIntegerhead. – halirutan Aug 18 '18 at 08:22f[x_head: head@1]won't be overwritten byf[x_head: 1]: https://i.stack.imgur.com/Yo0oy.png Not sure when this change is introduced. – xzczd Aug 18 '18 at 08:48