[Jprogramming] Y Combinator -- "the J way"

Raul Miller rauldmiller at gmail.com
Thu Jun 14 05:20:18 HKT 2012


On Wed, Jun 13, 2012 at 5:14 PM, I wrote:
>   (Y Ev successor)Ev 0
>
> This will hang the machine.
>
> So here we have a model for recursion in J which is not limited by the C stack.
>

On further testing I am not sure that this is free of the C stack --
it might just be a bug.

If I change the definition of successor such that it displays the
intermediate results, J crashes.

successor=: lambda 'f n'
  try. f`:6 ([ smoutput) n+1 catch. n end.
)

-- 
Raul


More information about the Programming mailing list