{'-'. {'+'. '1'. {'/'. '4'. '2'}}. '5'}
OMeta2 subclass: OMeta2Evaluator (env) start :env = calc. calc = {('+' | '-' | '*' | '/'):op calc:l calc:r} -> [l perform: op asSymbol with: r] | _:n ?[n first isDigit] -> [n asNumber] | _:n ?[n first isLetter] -> [env at: n ifAbsent: [Float nan]].
calc = {('+' | '-' | '*' | '/'):op calc:l calc:r} -> [l perform: op asSymbol with: r] | _:n ?[n first isDigit] -> [n asNumber] | _:n ?[n first isLetter] -> [env at: n ifAbsent: [Float nan]].
Alex Wrh
OMeta Can Manipulate Trees
Alex Wrh
{'a' -> 5. 'b' -> 10}
Do It
OMeta Can Manipulate Trees