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 { $n<2 ?? 1 !! $n*$f($n-1,$f)
}) }).(5);
say "OK";
say "OK";
$ pugs lambda1.p6
120
OK
OK
-----
The second program (lambda2.p6) has the first line repeated as a comment:
say (-> $n { -> $f { $f($n,$f) }.( -> $n, $f { $n<2 ?? 1 !! $n*$f($n-1,$f)
}) }).(5);
say "OK";
#say (-> $n { -> $f { $f($n,$f) }.( -> $n, $f { $n<2 ?? 1 !! $n*$f($n-1,$f)
}) }).(5);
say "OK";
$ pugs lambda2.p6
***
Unexpected "$"
expecting comment, operator, statement modifier, ";" or "}"
at lambda2.p6 line 3, column 10
So the comment causes an error!
-----
If I uncomment that line, I still get the same error (lambda3.p6):
$ pugs lambda3.p6
***
Unexpected "$"
expecting comment, operator, statement modifier, ";" or "}"
at lambda3.p6 line 3, column 9
The error is now at column 9 i.o. column 10.
Could anyone shed any light on what's going on here?
pugs Version: 6.2.12 (r13798)
perl v5.8.7
parrot 0.4.6
Thanks!
Wim
--
If it's pointless, what's the point?
If there is a point to it, what's the point?
(Tibor Fischer, "The Thought Gang")