This library provides a vocabulary for supporting simple infix math.
Expressions are processed from left to right.
The following should suffice:
needs infix'
with infix' 1 + 2 putn 4 * 2 + 3 putn
Name | Stack | Usage |
---|---|---|
+ | ( x"-y ) | 1 + 2 |
- | ( x"-y ) | 2 - 1 |
* | ( x"-y ) | 3 * 3 |
/ | ( x"-y ) | 4 / 2 |
mod | ( x"-y ) | 5 % 2 |
/mod | ( x"-qr ) | 5 /mod 2 |
^ | ( x"-n ) | 5 ^ 2 |