On "calculate PHRASE-X", perform "numeric evaluate X".
Then on "calculate PHRASE-X", if not, reply "i did not get that".
On "what is NUMERIC-PHRASE-X", perform "numeric evaluate X".
Then on "what is NUMERIC-PHRASE-X", perform "variable set SUBTOTAL ...".
Then on "what is NUMERIC-PHRASE-X", reply "X is ...".
Then on "what is NUMERIC-PHRASE-X", if not, reply "i did not get that".
##################
# Running total...
On "NUMERIC-X", perform "variable set SUBTOTAL X".
On "plus NUMERIC-X", perform "numeric evaluate $SUBTOTAL plus X".
Then on "plus NUMERIC-X", perform "variable set SUBTOTAL ...".
On "plus NUMERIC-X", perform "numeric evaluate $SUBTOTAL plus X".
Then on "plus NUMERIC-X", perform "variable set SUBTOTAL ...".
On "minus NUMERIC-X", perform "numeric evaluate $SUBTOTAL minus X".
Then on "minus NUMERIC-X", perform "variable set SUBTOTAL ...".
On "times NUMERIC-X", perform "numeric evaluate $SUBTOTAL times X".
Then on "times NUMERIC-X", perform "variable set SUBTOTAL ...".
On "divided by NUMERIC-X", perform "numeric evaluate $SUBTOTAL divided by X".
Then on "divided by NUMERIC-X", perform "variable set SUBTOTAL ...".
On "equals", reply "$SUBTOTAL".
##################
##################
# what a 6 7s -- needs "three" to "3" conversion!
On "what are X PLURAL-Y", perform "numeric evaluate X times Y".
Then on "what are X PLURAL-Y", reply "X is ...".
Then on "what are X PLURAL-Y", if not, reply "i did not get that".
On "X NUMERIC-PLURAL-Y are", think "what is X times SINGULAR-Y".