[Jprogramming] tail recursion optimization?

Dabrowski, Andrew John dabrowsa at indiana.edu
Wed Dec 20 20:34:26 UTC 2017


This isn't a complete workaround for tail recursion though.  The while function

F^:test^:_ arg


doesn't lend itself e.g. to recursion on substructures of arg.

To exercise my J muscles I've been playing around with 3n+1 problem, and I very quickly ran into stack errors.  Is there a way to expand the stack?


On 12/19/2017 06:07 PM, Raul Miller wrote:

J's induction operation ( ^: ) is very similar to tail recursion (in terms
of data flow) except that it does not have full recursion as one of its
failure modes.





More information about the Programming mailing list