PtcRunner.Lisp.RuntimeCallable (PtcRunner v0.11.0)

Copy Markdown View Source

Runtime callable for effectful qualified Lisp symbols.

Values such as tool/search are not plain functions: they need an evaluator context to enforce limits, record traces, and call the configured runtime executor. The persisted value only carries the qualified name. A short-lived bound form is created at application time for higher-order runtime calls.

Summary

Types

namespace()

@type namespace() :: :tool

t()

@type t() :: %PtcRunner.Lisp.RuntimeCallable{
  do_eval:
    (term(), PtcRunner.Lisp.Eval.Context.t() ->
       {:ok, term(), PtcRunner.Lisp.Eval.Context.t()} | {:error, term()})
    | nil,
  eval_ctx: PtcRunner.Lisp.Eval.Context.t() | nil,
  name: atom(),
  namespace: namespace()
}

Functions

bind(callable, eval_ctx, do_eval)

@spec bind(t(), PtcRunner.Lisp.Eval.Context.t(), function()) :: t()

call(callable, args)

@spec call(t(), [term()]) :: term()

invoke(callable, args, eval_ctx)

@spec invoke(t(), [term()], PtcRunner.Lisp.Eval.Context.t()) ::
  {:ok, term(), PtcRunner.Lisp.Eval.Context.t()} | {:error, term()}

label(runtime_callable)

@spec label(t()) :: String.t()

new(namespace, name)

@spec new(namespace(), atom()) :: t()

serializable?(arg1)

@spec serializable?(term()) :: boolean()

with_context(eval_ctx, do_eval, fun)

@spec with_context(PtcRunner.Lisp.Eval.Context.t(), function(), (-> term())) :: term()