core_eval
An evaluator for Core Erlang abstract syntax.
Parts of this module are heavily inspired inerl_eval
and some
helper functions (e.g. for binary matching and eval'ing) are copied
directly from there.
Summary
Types
Functions
- add_binding(Name, Value, Bindings)
- add_bindings(Names, Values, Bindings0)
-
expr(Expr)
Equivalent to
expr(Expr, #{})
. -
expr(Expr, Bindings)
Evaluate a Core Erlang expression.
-
exprs(Exprs)
Evaluate a list of Core Erlang expressions.
Types
bindings()
-type bindings() :: #{}.
value()
-type value() :: term().
Functions
add_binding(Name, Value, Bindings)
-spec add_binding(term(), value(), bindings()) -> bindings().
add_bindings(Names, Values, Bindings0)
-spec add_bindings([cerl:var_name()], [value()], bindings()) ->
bindings().
expr(Expr)
-spec expr(cerl:cerl()) -> value().
Equivalent to expr(Expr, #{})
.
expr(Expr, Bindings)
-spec expr(cerl:cerl(), bindings()) -> value().
Evaluate a Core Erlang expression.
exprs(Exprs)
-spec exprs([cerl:cerl()]) -> value().
Evaluate a list of Core Erlang expressions.