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:

  1. Nodes can be agregated into lists, dicts etc. to create compact code.
  2. The same holds for views.
  3. Node.tagged enables you to attach arbitrary information to a Node, apart from its new and old value.
  4. 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 =