PtcRunner.Lisp.Analyze.ShortFn (PtcRunner v0.9.0)

Copy Markdown View Source

Analyzer for short function syntax (#()).

Transforms short function forms into desugared anonymous functions by extracting placeholders (%, %1, %2, etc.) and generating parameters.

Summary

Functions

Desugars short function syntax into a transformed AST.

Functions

desugar(body_asts)

@spec desugar([term()]) :: {:ok, term()} | {:error, term()}

Desugars short function syntax into a transformed AST.

Takes the body ASTs from a short_fn form and returns a desugared form as a list-based fn form, ready for the parent analyzer to process.

Returns {:ok, desugared_ast} on success or {:error, error_reason()} on failure.