coalton-codegen-types compiles top-level Coalton forms and returns the generated Common Lisp code—including all emitted Common Lisp type declarations—as a quoted s-expression.
Syntax
(coalton-codegen-types
⟨toplevel-form⟩*)
Semantics
coalton-codegen-typesaccepts the same top-level forms ascoalton-toplevel.- It runs the full Coalton compiler pipeline with
coalton-impl/settings:*emit-type-annotations*bound tot, emitting Common Lisp(declaim (ftype ...)),(declare (type ...)), and(the (values ...) ...)forms. - It expands to a quoted Common Lisp
(progn ...)form containing the generated code, returning it as data without executing the generated definitions or permanently modifying*global-environment*.
Examples
(coalton-codegen-types
(declare double (UFix -> UFix))
(define (double x)
(+ x x)))
Other notes
- For formatted output printed to
*standard-output*with local package prefixes stripped, usepprint-coalton-codegen-types. - To inspect the generated Common Lisp without type declarations, use
coalton-codegenorpprint-coalton-codegen.