Skip to content

local-expand #247

Description

@gelisam

We can imagine two versions of local-expand.

local-expand-syntax executes at phase 1, takes a Syntax object and expands it at phase 0, producing a Syntax object. Syntax objects can be deconstructed with open-syntax, spliced into larger Syntax objects with close-syntax, and eventually returned by the macro.

local-expand-core executes at phase 1, takes a Syntax object and expands it at phase 0, producing an opaque value of type Core. Values of type Core can be deconstructed carefully, producing well-formed Core sub-terms, they can be embedded into larger Syntax objects, and eventually returned by the macro.

One disadvantage of local-expand-syntax is that once the Syntax it returns is returned by the macro, the expander needs to expand it again, even though it is known to already contain only core constructs. This can lead to quadratic performance in some cases, and for this reason, we have long wanted Klister to have local-expand-core.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions