PtcRunner.Lisp.Eval.Helpers (PtcRunner v0.9.0)

Copy Markdown View Source

Shared helper functions for Lisp evaluation.

Provides type error formatting and type description utilities.

Summary

Functions

Describes the type of a value for error messages.

Formats closure errors with helpful messages.

Generates a type error tuple for FunctionClauseError in builtins.

Functions

describe_type(x)

@spec describe_type(term()) :: String.t()

Describes the type of a value for error messages.

format_closure_error(reason)

@spec format_closure_error(term()) :: String.t()

Formats closure errors with helpful messages.

type_error_for_args(fun, args)

@spec type_error_for_args(function(), [term()]) :: {:type_error, String.t(), term()}

Generates a type error tuple for FunctionClauseError in builtins.