2 ms·
I remember fondly having figured out how to implement precedence with two stacks, one for operations and other for operands, the same way my Texas Instruments c
by rbanffy 2y ago
I remember fondly having figured out how to implement precedence with two stacks, one for operations and other for operands, the same way my Texas Instruments calculator did.
It is possible to implement a desktop accessory calculator in a lunch break, but only because you get a whole lot of abstraction done by the GUI environment. Modelling the UI as a state machine in this case is essential so you don’t get crazy with all the corner cases.