Daniel Ruoso wrote:
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 +....

Does Perl 6 still have the word barrier \b regex? Maybe some sort of character class that matches spaces and word boundaries? I dunno...


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...

Well, * is implemented, so I guess you are talking about complex expressions.

Daniel.

Reply via email to