http://sial.org/pbot/37077 A slightly improved syntax, as per jnthn++ suggestion...
Em Sáb, 2009-06-06 às 18:08 +0200, Daniel Carrera escreveu: > Daniel Carrera wrote > > Ok, try again: > > % perl6 rpn.pl "2 2+" > > 2 2 > You can probably fix that with a different split() line. I tried using > <ws> instead of \s+ but the program just hangs forever. Hmm.. it certainly is in the split, I'm not sure how to get the barrier between the 2 and the +.... > I also tried a more complex expression, and the calculator didn't like it: > % perl6 rpn.pl "5 4 + 3 / 5 3 - *" > Error parsing expression near * er... that's because I didn't tried to implement it... but it certainly is possible to, just by declaring the :(@a, Num $a) variant... daniel