[Jprogramming] Tacit exercise

Dan Bron j at bron.us
Fri Dec 18 03:03:04 HKT 2009


Thomas Costigliola wrote:
>   Recursive solutions, when written clearly,  are easy to reason about and often seem obviously correct.

I think this is a fair statement, qualified with "depending on the notion they express".  I do not think all loops would be easier
to understand as recursive calls.

I am leery of recursion in J.  It's not that $: & friends always break; the stack depth is sufficient for many needs, it's just that
I don't even want to *worry* about it.  I wish the interpreter optimized tail calls, and my intuition is that it would be easy to
identify optimizable verbs algebraically.  At least the tacit ones.

-Dan

PS:  The test suite for Markov engines can be found concretely in J here:   

  http://www.jsoftware.com/svn/DanBron/trunk/challenge/RosettaCode/MarkovAlgorithm/MarkovAlgorithm.ijs 

Look for blocks that start with "assert".  Or you can get them directly from the source, the task description on RC:

  http://rosettacode.org/wiki/Markov_Algorithm




More information about the Programming mailing list