Tutorial example CalculatorRpn
Files
In tutorial example CalculatorRpn the Pull pattern is used to construct a fairly functional calculator.
The example illustrates the following points:
- Nodes can be agregated into lists, dicts etc. to create compact code.
- The same holds for views.
- Node.tagged enables you to attach arbitrary information to a Node, apart from its new and old value.
- Node.old can be used to access the state of a Node before the most recent event triggered by the user.
Remark: The calculator is of the RPN or postfix type, expecting as input format e.g.
3 [enter] 5 *
rather than
3 * 5 =