Skip to content

Values

A value at runtime is a Val. The Val union is wide because Omega reifies many things — machines, contexts, profiles, distributions, contradictions — that other Lisps either hide or omit. This page is a survey of what's available and how the categories relate.

The base atoms

ts
{ tag: "Unit" }
{ tag: "Uninit" }
{ tag: "Num"; n: number }
IntVal                       // bigint-backed integers
{ tag: "Bool"; b: boolean }
{ tag: "Str"; s: string }
{ tag: "Char"; c: string }   // 1-character string
{ tag: "Sym"; name: string }

Containers

ts
ListVal                      // proper Lisp list
{ tag: "Pair"; car: Val; cdr: Val }
{ tag: "Vector"; items: Val[] }
{ tag: "Map"; entries: Array<[Val, Val]> }

Function-like

ts
{ tag: "Closure"; params: string[]; rest?: string; body: Expr; env: Env; name?: string }
{ tag: "Native"; name: string; arity: number | "variadic"; lazyArgs?: number[]; fn: ... }
{ tag: "OracleProc"; params: string[]; spec: Val; env: Env; policyDigest?: string }
{ tag: "Cont"; ... }                  // delimited-handler continuation
ContinuationVal                       // first-class undelimited continuation (call/cc)

OracleProc is special: it's a procedure whose implementation is an LLM call governed by a policy.

Reified runtime

ts
MachineVal      // tag: "Machine" — reified CESK state for stepping/forking
ProfileVal      // tag: "Profile" — first-class governance config
CtxVal          // reified context (env+evidence+constraints), used with ctx/snapshot
ModuleVal       // sealed module with attenuated capabilities
ReceiptRefVal   // reference to a stored provenance receipt

The Meaning protocol

ts
MeaningVal      // semantic artifact: { value, denotation, evidence, obligations }
DistVal         // distribution over Vals (uncertain LLM outputs)

Meaning is what an oracle call returns when it succeeds: the semantic content (the value), provenance (evidence), and any obligations the caller must discharge for the meaning to remain valid.

Constraints and contradictions

ts
ConnRefVal              // connector cell in a constraint network
NetRefVal               // a network identifier
ExplanationVal          // assumption | derived | conflict | denied
ContradictionVal        // a contradiction is a value, not an exception

Contradictions don't throw. You get a Contradiction value with an explanation graph — pass it to (repair ...) to synthesize fixes via amb.

Concurrency primitives

ts
FiberVal     // lightweight cooperatively-scheduled fiber
MutexVal     // mutual exclusion
IVarVal      // write-once synchronization variable
ChannelVal   // communication channel
ActorVal     // actor with mailbox

These are NOT Matrix actors. They're in-process concurrency primitives the language ships with, useful inside an Omega session.

Streams, promises, IR, errors

ts
PromiseVal      // memoized thunk
StreamVal       // lazy infinite sequence marker
IRVal           // compiled IR artifact
ErrVal          // error value (separate from Condition)
ConditionVal    // structured condition (raised/handled like exceptions)

Generic dispatch

ts
TaggedVal           // value with a semantic type tag
GenericRegistryVal  // method dispatch table
GenericMissVal      // unresolved dispatch

Solver values (Job 008)

ts
BudgetVal           // typed budget for solvers
ResultVal           // solver result
CostEstimateVal
SolverVal           // first-class solver
FactStoreVal        // monotone fact store

Language-building values

ts
EvaluatorVal        // custom evaluator with extended primitives
MacroTransformerVal
ArtifactVal         // typed data for solve decomposition
GoalVal             // what to accomplish
TableVal            // mutable hash table (used by problem-recognizer)

How to interact

The tag field is the discriminant. From TypeScript:

ts
function describe(v: Val): string {
  switch (v.tag) {
    case "Num":     return `number ${v.n}`;
    case "Closure": return `closure ${v.name ?? "<anon>"}/${v.params.length}`;
    case "Meaning": return `meaning denoting ${(v as MeaningVal).denotation}`;
    // ...
  }
}

From Lisp, the standard predicates apply: number?, string?, procedure?, meaning?, contradiction?, etc. Type predicates are part of the standard library (see Reference: built-ins).

See also

Source: projects/omega-lisp/src/core/eval/values.ts:710-762 is the canonical Val union; individual variant types are defined throughout the same file.