EvaluateResult
From @lionlang/core/types/evaluation
evaluate and every special form handler:
The evaluated Lion value. The type is
unknown because Lion expressions can
produce any JSON-compatible value, a JavaScript function (from lambda), or
any host value that was placed in the environment.A union of the three error types that can occur during evaluation. All three
are typed so you can handle them selectively with
Effect.catchTag or
Effect.catchAll.The Effect context dependency.
evaluate requires this service to resolve
environment references and to support define. run fulfills this
requirement automatically, so the Effect it returns has never as its
requirements type.ArgumentMismatchError
From @lionlang/core/errors/evaluation
The discriminant tag. Use
Effect.catchTag("ArgumentMismatchError", ...) to
handle this error selectively.Handling example
InvalidFunctionCallError
From @lionlang/core/errors/evaluation
The discriminant tag. Use
Effect.catchTag("InvalidFunctionCallError", ...)
to handle this error selectively.The array expression that triggered the error. Inspect this field to identify
which expression head failed to resolve to a function.
Handling example
LionEnvironmentService
From @lionlang/core/services/evaluation
Context.Tag that carries the active Environment through the evaluation pipeline.
The string identifier used by Effect’s context system to locate the service.
The
Environment instance holding the mutable bindings Ref and,
for inner scopes, a reference to the parent environment.Callers using
run do not need to interact with LionEnvironmentService
directly — run provisions it automatically from the environment argument.
You only need this tag when composing evaluate manually or writing a custom
special form handler that needs to read or modify the environment.getService
From @lionlang/core/services/evaluation
evaluatePrimitive and the special form handlers to access the current LionEnvironmentService: