Expand description
Sema — a Lisp with LLM primitives.
This module provides a clean embedding API for the Sema interpreter.
§Quick Start
use sema::{Interpreter, InterpreterBuilder, Value};
let interp = InterpreterBuilder::new().build();
let result = interp.eval_str("(+ 1 2)").unwrap();
assert_eq!(result, Value::int(3));Structs§
- Caps
- Env
- A Sema environment: a chain of scopes with bindings.
- Interpreter
- A Sema Lisp interpreter instance.
- Interpreter
Builder - Builder for configuring and constructing an
Interpreter. - Sandbox
- Value
- The core Value type for all Sema data. NaN-boxed: stored as 8 bytes. Floats stored directly, everything else encoded in quiet-NaN payload space.
Enums§
Functions§
- intern
- Intern a string, returning a Spur key.
- resolve
- Resolve a Spur key back to a String.
- with_
resolved - Resolve a Spur and call f with the &str, avoiding allocation.
Type Aliases§
- Eval
Result - Result of evaluating a Sema expression.
- Result