Skip to content

non-recursive macroexpand #19365

@tpapp

Description

@tpapp

Currently

macro foo(args...)
    args2 = do_something(args)
    quote
        @bar($(args2...))
    end
end
macroexpand(:(@foo arg1 arg2))

expands all the macros in the expression recursively.

This makes debugging difficult if the expansion of the inner macro is a complicated expression.

It would be nice to have an alternative, possibly either called macroexpand1, or macroexpand(expr, recursive=false), that would only expand the first level, similarly to COMMON-LISP:MACROEXPAND-1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:loweringSyntax lowering (compiler front end, 2nd stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions