I have a function f[zs] and a function fb[zs, base] with a parameter zs that is a list of nonempty lists of integers. The parameter is defined as zs:{{__Integer}...}
For short lists the functions can be called without problem.
When the list gets longer (e.g. about 5000 elements) the parameter match of fb[zs, base] no longer works. I get an error: "General::maxrec: Recursion limit exceeded; positive match might be missed.". f[zs] still works.
f[zs] seems to remain working for even very long lists.
Can anybody explain this behavior? Is this a bug within Wolfram or is there a mistake within my coding?
Block[{digits = 8, maxAnz = 5000, f, fb, zs},
f[zs : {{__Integer} ...}] := {Length[zs]};
fb[zs : {{__Integer} ...}, base_Integer : 10] := {base, Length[zs]};
Echo[$RecursionLimit, ".$RecursionLimit: "];
(* Make zs = List of Lists *)
zs = Partition[Range[maxAnz*digits], digits];
Echo[Column[{{digits, Length[zs]}, Short[zs, 7]}],
".{digits,Length[zs]},zs}: "];
(* Test zs-Pattern within f[zs] *)
Echo[Short[f[zs], 7], ".f[zs]: "];
(* Test zs-Pattern within fb[zs,base] *)
Echo[Short[fb[zs, digits], 7], ".fb[zs,digits]: "];
(* The List of List - Pattern is ok *)
Echo[zs = Take[zs, 5], ".zs begin:"];
Trace[MatchQ[zs, {{__Integer} ...}]]
]