Anonymous user
Arithmetic evaluation: Difference between revisions
→{{header|OCaml}}
(→{{header|Common Lisp}}: Rewrite using more natural token representation, use of backquote, translation from infix to prefix and direct eval. More syntax error checking cases added.) |
|||
Line 1,841:
| Quot of expression * expression (* e1 / e2 *)
let rec eval
| Const c -> c
| Sum (f, g) -> eval f +. eval g
|