PtcRunner.Lisp.Env.Builtin (PtcRunner v0.11.0)

Copy Markdown View Source

Metadata wrapper for callable environment builtins.

Runtime-created callables still use the raw tuple shapes; this wrapper is for Env bindings where we know the public builtin name and validation contract.

Summary

Types

raw_binding()

@type raw_binding() ::
  {:normal, function()}
  | {:variadic, function(), term()}
  | {:variadic_nonempty, atom(), function()}
  | {:multi_arity, atom(), tuple()}
  | {:collect, function()}

t()

@type t() :: %PtcRunner.Lisp.Env.Builtin{
  args: term(),
  binding: raw_binding(),
  name: atom()
}

Functions

args(arg1)

@spec args(t() | term()) :: term()

builtin?(arg1)

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

name(arg1)

@spec name(t() | term()) :: atom() | nil

unwrap(other)

@spec unwrap(t() | term()) :: term()

wrap(name, binding, args \\ :unchecked)

@spec wrap(atom(), raw_binding(), term()) :: t()