Skip to main content

ExtValue

Type Alias ExtValue 

Source
pub type ExtValue = Value;
Expand description

Re-exported tatara_lisp_eval::Value. Host intrinsics return this from their callable.

Aliased Type§

pub enum ExtValue {
Show 15 variants Nil, Bool(bool), Int(i64), Float(f64), Str(Arc<str>), Symbol(Arc<str>), Keyword(Arc<str>), List(Arc<Vec<Value>>), Map(Arc<HashMap<MapKey, Value>>), Closure(Arc<Closure>), NativeFn(Arc<NativeFn>), Promise(Arc<Mutex<PromiseState>>), Error(Arc<ErrorObj>), Sexp(Sexp, Span), Foreign(Arc<dyn Any + Send + Sync>),
}

Variants§

§

Nil

§

Bool(bool)

§

Int(i64)

§

Float(f64)

§

Str(Arc<str>)

§

Symbol(Arc<str>)

§

Keyword(Arc<str>)

§

List(Arc<Vec<Value>>)

§

Map(Arc<HashMap<MapKey, Value>>)

Persistent hash map keyed by a hashable subset of Value (Bool, Int, Float, Str, Symbol, Keyword, Nil). Inserting / removing yields a new Map (copy-on-write via Arc).

§

Closure(Arc<Closure>)

§

NativeFn(Arc<NativeFn>)

§

Promise(Arc<Mutex<PromiseState>>)

A delayed (lazy) computation. First force triggers evaluation of the underlying thunk; subsequent forces return the cached result. Backed by Mutex so a Promise can be shared across references safely (single-threaded runtime, but the lock is trivial overhead and gives us zero-effort safety).

§

Error(Arc<ErrorObj>)

A first-class structured error — Clojure ex-info shape: a tag (keyword/string), a message string, and a data plist. Constructed by (error tag msg data) / (ex-info msg data). Raised by (throw err). Caught by (try ... (catch (e) ...)).

§

Sexp(Sexp, Span)

Escape hatch: unevaluated source form carried as a value, e.g. after (quote x). Preserves span info.

§

Foreign(Arc<dyn Any + Send + Sync>)

Opaque host-owned value. The embedder supplies these via FFI; native functions read them back via downcast. Used to expose typed Rust handles (job refs, client handles) to Lisp code.