While working on the Y combinator rosettacode entry (
https://rosettacode.org/wiki/Y_combinator#Explicit_alternate_implementation
), I ran into what looks like a bug.

If I write the combinator this way:

Y=:2 :0(0 :0)
  f=. u (1 :n)
  (5!:1<'f') f y
)
:
  g=. x&(x`:6)
  (5!:1<'g') u y
)

I get a domain error when I try to use it, because that : line gets lost.

It's present when I inspect the 0 :0 result, but it vanishes from the
5!:1 generated result.

It looks like the code is trying to simplify for the 4 :0 case, even
though it turns out that that is not relevant.

Thanks,

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

Reply via email to