error when using - as lambda function

2006-10-03 Thread Wim Vanderbauwhede
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

Operator overloading/Inheritance from built-in types?

2006-10-05 Thread Wim Vanderbauwhede
Hi all, I want to create a kind of bitvector object. Ideally, I'd like to inherit from Array and then overload [],=, +,- etc. I tried to overload the '+' operator, but I can't get it to work as a method. Also, I'd like to overload the assignment operator. Is that at all possible? Below is my

pugs bugs (or features?)

2007-09-07 Thread Wim Vanderbauwhede
The following program works fine in pugs r17041 (which is the rev of /usr/bin/pugs on feather): my $r=\{say $x+1}; my $x=2; $r(); With r17041, this gives 3; However, on the latest pugs (r17615 or later), it gives an error: *** Unexpected $r expecting =, ::, context, : or ( Variable