Anonymous recursion: Difference between revisions

m
Line 916:
 
<code>$:</code> is an anonymous reference to the largest containing verb in the sentence.
 
-------------
 
Note also http://www.jsoftware.com/pipermail/general/2003-August/015571.html which points out that the form
 
<lang j>basis ` ($: @: g) @. test</lang> is an anonymous form matches the "tail recursion" pattern. However, J does not automatically perform the classic "tail recursion optimization" which would be implemented as transforming this particular example of recursion to the non-recursive <lang j>basis @: (g^:test^:_)</lang>
 
Of course, that won't work here, because we are adding two recursively obtained results where tail recursion requires that the recursive result is the final result.
6,962

edits