Expand description
Elly — a small language layered on Muon (see docs/elly-spec.md).
This crate implements the first, deliberately small subset: references,
application, & abstraction, symbols, and positional lists with
projection. It reads the syntax with the muon crate, parses that notation
tree into an Expr, and evaluates it with a naive tree-walking
evaluator.
let expr = elly::parse("(&x x) .foo").unwrap();
assert_eq!(elly::eval(&expr).unwrap().to_display(), ".foo");Enums§
- Builtin
- A native builtin operation in the reserved
__namespace. All are curried; see the integers section ofdocs/elly-spec.md. - EnvNode
- One link of the environment list. A binding is a source name (patterns only
ever bind names —
Discardbinds nothing, so there is no synthetic key). - Error
- A failure at the syntax or parse stage.
- Expr
- An Elly expression in the first subset. Strings and records are deferred (see the spec), so there is no variant for them yet.
- Parse
Error - A parse failure: the input is a valid Muon tree but not a well-formed Elly program in this subset.
- Raised
- A value unwinding through the single error channel (see the errors section
of
docs/elly-spec.md). Evaluation returnsResult<Value, Raised>; a raise unwinds the?chain up to the nearest boundary. Two kinds unwind together, differing only in what catches them: - Value
- A runtime value.
Functions§
- eval
- Evaluate an expression in the empty environment.
- parse
- Parse Elly source into an
Expr: read the Muon syntax, then parse that notation tree into the AST. - parse_
program - Parse a whole parsed program (one top-level chain) to an expression.
Type Aliases§
- Env
- A shared, persistent environment.