Core, validated AST for PTC-Lisp.
This module defines the type specifications for the intermediate representation that the analyzer produces. The interpreter evaluates CoreAST to produce results.
Pipeline
source → Parser → RawAST → Analyze → CoreAST → Eval → result
Summary
Functions
Validates the complete CoreAST algebra, including recursive Java nodes.
Types
@type pattern() :: {:var, name()} | {:destructure, {:keys, [name()], [{name(), term()}]}} | {:destructure, {:map, [name()], [{pattern(), name()}], [{name(), term()}]}} | {:destructure, {:as, name(), pattern()}} | {:destructure, {:seq, [pattern()]}} | {:destructure, {:seq_rest, [pattern()], pattern()}}
@type t() :: literal() | {:vector, [t()]} | {:map, [{t(), t()}]} | {:set, [t()]} | {:var, name()} | {:data, name()} | {:runtime_callable, :tool, name()} | {:turn_history, 1 | 2 | 3} | {:literal, term()} | {:call, t(), [t()]} | {:let, [binding()], t()} | {:if, t(), t(), t()} | {:fn, fn_params(), t()} | {:fn, name(), fn_params(), t()} | {:do, [t()]} | {:and, [t()]} | {:or, [t()]} | {:juxt, [t()]} | {:pmap, t(), [t()]} | {:pcalls, [t()]} | {:return, t()} | {:fail, t()} | {:tool_call, name(), [t()]} | {:prelude_ref, String.t()} | {:prelude_call, String.t(), [t()]} | {:java_static, atom(), [t()]} | {:java_new, atom(), [t()]} | {:java_field, atom()} | {:java_instance, atom(), t(), [t()]} | {:java_dot, atom(), t(), [t()]} | {:java_ref, atom()} | {:def, name(), t(), map()} | {:defonce, name(), t(), map()} | {:loop, [binding()], t()} | {:recur, [t()]}
@type validation_error() :: {:invalid_core_ast, [non_neg_integer()], term()}
Functions
@spec validate(term()) :: :ok | {:error, validation_error()}
Validates the complete CoreAST algebra, including recursive Java nodes.