To Bill, Mark and Marvin....
Here is a little code snipet that will cause APL to close.
½–(4×a)½"'a' "
For my current situation, setting a to 23508 will cause APL+Win v5.2.05 to fail. 23507 does not. The number is higher in v4.0.03, around 29000. V4 will however also fail if a is high enough. I'm not sure if 23508 is a hard number for v5.2.05, or just a number for my current setup.
Motivation for the above code. The below construct is true:
'a' 'b' 'c' 'abc'
Note, there is a Match character between the 'c' and 'abc', and Match does not appear for me in IE6SP2.
The above is true, but there is a difference that is detectable in the interpreter. Here is a program which I believe was talked about on the comp.lang.apl news group, which can differenciate the above vectors.
’ ret„IsNested arg;tmp
[1] :if (Œdr arg)¹326 807 ª ret„1
[2] :elseif 82=Œdr arg
[3] tmp„(½arg)½'*'
[4] :if =/Œsize 'arg tmp' ª ret„0
[5] :else ª ret„1
[6] :end
[7] :end
’
Sample runs:
IsNested 'abc'
0
IsNested 'a' 'b' 'c'
1
I was running a test to see if the above would remain true for multiple elements, and indeed it holds up to 23507 elements. The Interpreter fails on the 23508th element.
Truly, the function IsNested is actually returning an invalid result because indeed, the two vectors are identical. But in some situations, I have liked being able to detect how the vector was entered. That is, 'a' 'b' 'c' vs 'abc', even though I should not! In all situations I have tested, IsNested works, up to the point of Interpreter failure. Enjoy!