Shared helper functions for Lisp evaluation.
Provides type error formatting and type description utilities.
Summary
Functions
Returns the definition-only-form hint for the first matching name, or nil.
Describes the type of a value for error messages.
Formats closure errors with helpful messages.
Generates a type error tuple for FunctionClauseError in builtins.
Returns the trailing hint for one or more unresolved names, or "".
Functions
Returns the definition-only-form hint for the first matching name, or nil.
Accepts one name or a list of them, and answers nil for anything else so
callers projecting untrusted diagnostic detail need no shape check first.
Describes the type of a value for error messages.
Formats closure errors with helpful messages.
Generates a type error tuple for FunctionClauseError in builtins.
Returns the trailing hint for one or more unresolved names, or "".
A failed lookup takes the highest rung it can reach: name one alternative that was resolved first, list the bounded set the name must have come from, or point at search. The rungs are not interchangeable — the first two cost the model no turns and the third costs one — and none of them may print a name that was not looked up, because a plausible name that does not exist costs the same turn twice.
A form that is absent by category — an import, a macro, constructed-source evaluation, file I/O — is told so. Pointing those at search spends a turn on a query that cannot succeed.
Several unresolved names share one message, and neither a suggestion nor a search term for one of them applies to the rest, so only the category rungs run for a list.