I can cheat, by hiding the assignment in another function.
AAr =: 1 : '(5!:1 < ''a'') a =. 1 : m'
'u u`:6('',(5!:5<''u''),'')`:6 y' AAr
<(<,':'),<(<(,'0');1),<(,'0');,:'u u`:6('',(5!:5<''u''),'')`:6 y' (1 : 'u
u`:6('',(5!:5<''u''),'')`:6 y')
this is not the same as Y though.
but this is,
YAr =: 1 : '1 : (''(5!:1 < ''''a'''') a =. 1 : '' , ''('' , m , '')'' )'
Y1 =. '''u u`:6('',(5!:5<''u''),'')`:6 y''' YAr
________________________________
From: Jose Mario Quintana <[email protected]>
To: [email protected]
Sent: Thursday, November 15, 2018 6:01 PM
Subject: Re: [Jprogramming] Revisisting the Y combinator
Some authors regard functional programming as programming without any
assignments.
The wicked tacit fixed version of Y has no assignments whatsoever but it is
produced and it works by means of non-standard J code. I could alter
slightly the non-tacit version,
Y=. '(5!:1<''v'')v=. 1 : (''u u`:6('',(5!:5<''u''),'')`:6 y'')'(1 :)
and get rid of its single assignment using a bit of wicked code but that
defeats my purpose.
I cannot figure out how to produce an orthodox version of Y with no
assignments; then again, Y, actually, XY was the most complicated non-tacit
entity I have produced in a couple of decades and my failure probably means
little.
I would be very interested to see an orthodox version of Y with no
assignments if anyone can produce one.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm