Internal raw-definition spec gathered by
PtcRunner.Lisp.Prelude.Compiler during its AST walk, before
host-boundary %PtcRunner.Lisp.Prelude.Export{} records are built and
before the callable private env is captured.
Not part of the public prelude artifact — it carries the raw parser forms
(params_form, body_form) that the compiler needs to both build export
metadata and reconstruct definition forms for env capture.
form_index is the definition's zero-based top-level source position. It
lets validation phases after the initial AST walk retain precise diagnostic
attribution without teaching each validation helper about source text.
metadata_form is the raw {:map, pairs} parser node captured from a
def, defn, or defn- before normalize_meta/1 flattens it into the (lossy,
order-destroying) metadata map. It exists so source discovery can render
the author's metadata Formatter-faithfully with original key order; metadata
(normalized) still drives everything else. It is nil when no metadata map
was authored.
Summary
Types
@type t() :: %PtcRunner.Lisp.Prelude.Spec{ arity: non_neg_integer() | :variadic, body_form: [term()], doc: String.t() | nil, form_index: non_neg_integer(), metadata: map(), metadata_form: {:map, [term()]} | nil, namespace: String.t(), params_form: term() | nil, private?: boolean(), symbol: String.t() }