Jump to content

Anonymous recursion: Difference between revisions

m
Line 921:
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,but J doesis not automatically performtransformed to satisfy the classic "tail recursion optimization". whichThat optimization 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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.