I may not have an accurate understanding of the relationship between
function-level iteration in J and tail recursion. I'm particularly
interested in Power (^:) but several other primaries may apply, most
obviously Self.

Up to now I've thought that tail recursion is not applicable to J.
Thus in a discussion of functional programming on Twitter I've said
that J provides a counterexample which refutes the claim that
tail-call optimization (TCO) is necessary and important to a
"functional programming" computer language.

As I've studied more on the topic of TCO it occurred to me that
perhaps J's memory-management may rightly be labeled TCO in the cases
I have in mind. As examples, consider f1a and f1b here:
http://www.jsoftware.com/jwiki/Essays/Fibonacci%20Sequence

My questions, then, are:

Does J sometimes involve tail recursion?

If yes, but not in all recursions, how can we differentiate?

Is ^: best thought of as non-recursive? Does such categorization matter?

Thanks,

Tracy
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to