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-types accepts the same top-level forms as coalton-toplevel.
  • It runs the full Coalton compiler pipeline with coalton-impl/settings:*emit-type-annotations* bound to t, 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