RosettaCodeData/Task/Y-combinator/J/y-combinator-6.j
2025-06-11 20:16:52 -04:00

6 lines
404 B
Text

sr=. [ apply f. ,&< NB. Self referring
lv=. ]:^:_1 b.]:`(<'0';_1)`:6 NB. Linear representation of a verb operand
Y =. ]:&>/lv&sr NB. Y with embedded states
Y =. 'Y' f. NB. Fixing it...
Y NB. ... To make it stateless (i.e., a combinator)
((]: & >) / ((((]: ^: (_1)) b. ]:) ` (<'0';_1)) `: 6)) & ([ 128!:2 ,&<)