Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 635 Bytes

File metadata and controls

33 lines (22 loc) · 635 Bytes

DIFF

DIFF extends CONST with difference expressions:

-(456, 123)

Each operand is itself an expression, so they can be nested:

-(2, -(4, 3))

That one change introduces recursion throughout the grammar, AST, parser, and evaluator.

For a closer look, read DIFF: When Expressions Contain Expressions.

To try it, you'll need Nix with flakes enabled.

nix develop
elm repl

Then:

import DIFF.Interpreter as I

I.run "-(456, 123)"
-- Ok (VNumber 333)