||:@include: lib/rpn.nv ||:: a = b + c ||:: d = a + # 1 ||:: b = 1 ||:: c = 2 |:: $x = $y $op $z| :: create some cells :names: ($x $y $z) :: create an operator :operation: $op :inputs: $y $z :output: $x |:: $x = # $y $op $z| :: $x = $y $op $z :: set $y to $y |:: $x = $y $op # $z| :: $x = $y $op $z :: set $z to $z |:: $x = # $y $op # $z| :: $x = $y $op $z :: set $y to $y :: set $z to $z |:: $x = $y| :: change $x to $y |:: create a cell named $cell| :: create some cells :names: $cell |:: create some cells? :value: $cell $value| |:: create some cells? :value: $cell | |:: create some cells? :no such cell: $cell | :cells: $cell |:: create some cells? :names: $cell| :: fetch the value of $cell |:: create some cells| |:: fetch the value of $cell :cells: $cell $value?| :value: $cell $value :: reset cells |:: fetch the value of $cell :cells: $cell?| :value: $cell :: reset cells |:: fetch the value of $cell? :cells: $ $value| :checked cells: $ $value |:: fetch the value of $cell? :cells: $| :checked cells: $ |:: fetch the value of $cell| :no such cell: $cell :: reset cells |:: reset cells? :checked cells: $cell $value| :cells: $cell $value |:: reset cells? :checked cells: $cell| :cells: $cell |:: reset cells| |:: create an operator :operation: $operation :inputs: $first $second :output: $output |:operators: $operation $first $second $output |:: change $cell to $value| :: set $cell to $value :: propagate $cell |:: set $cell to $value :cells: $cell $| :cells: $cell $value :: reset cells |:: set $cell to $value :cells: $cell| :cells: $cell $value :: reset cells |:: set $cell to $value? :cells: $x $y| :checked cells: $x $y |:: set $cell to $value? :cells: $| :checked cells: $ |:: set $cell to $value| :: create a cell named $cell :: change $cell to $value |:: propagate $cell| :: search for an operator that takes $cell as an input :: unpack that operator :: perform the operation |:: search for an operator that takes $cell as an input :operators: $op $cell $second $output? | |:: search for an operator that takes $cell as an input :operators: $op $first $cell $output? | |:: search for an operator that takes $cell as an input? :operators: $op $first $second $output |:checked operators: $op $first $second $output |:: search for an operator that takes $cell as an input| :no operator found: :: reset operators |:: reset operators? :checked operators: $op $first $second $output| :operators: $op $first $second $output |:: reset operators| |:: unpack that operator :no operator found:| |:: unpack that operator :operators: $op $first $second $output?| :operation: $op :output: $output :: fetch the value of $first :: fetch the value of $second :: reset operators |:: perform the operation :@rpn data: $value :output: $cell| :: change $cell to $value |:: perform the operation? :operation: $op :value: $c1 $v1 :value: $c2 $v2 |:@rpn: ($v2 $v1 $op) |:: perform the operation :operation: $op :value: $c1 $ :value: $c2 :output: $o | |:: perform the operation :operation: $op :value: $c1 :value: $c2 $ :output: $out | |:: perform the operation|