Hi all,
I encountered this strange error in pugs (in 6.2.11,6.2.12 and the latest
svn)
My first program (lambda1.p6) calculates the factorial of 5 using - as
lambda functions:
say (- $n { - $f { $f($n,$f) }.( - $n, $f { $n2 ?? 1 !! $n*$f($n-1,$f)
}) }).(5);
say OK;
say OK;
$ pugs lambda1.p6
在 Oct 3, 2006 10:22 PM 時,Wim Vanderbauwhede 寫到:
say (- $n { - $f { $f($n,$f) }.( - $n, $f { $n2 ?? 1 !! $n*$f
($n-1,$f)
}) }).(5);
say OK;
#say (- $n { - $f { $f($n,$f) }.( - $n, $f { $n2 ?? 1 !! $n*$f
($n-1,$f)
}) }).(5);
say OK;
It's extremely subtle -- $n2 should never have parsed in