Skip to content

support syntax macro OtherPackage.theirmacro(args...) ... end #54488

Open
@schlichtanders

Description

@schlichtanders

As a outcome from this discourse issue https://discourse.julialang.org/t/how-to-define-a-macro-via-package-extension/114218/5
I want to open an issue to track that the syntax to extend functions and macros do not match.

While extending functions and macros works the same when importing them (like import OtherPackage: @theirmacro), using qualified definitions only works for functions.

works:

function OtherPackage.theirfunction(args...)
    # works
end

doesn't work:

macro OtherPackage.theirmacro(args...)
    # fails with `ERROR: syntax: invalid macro definition ...`
end

As the functionality of extending is already support for both, it would be great if also the syntax support is consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    parserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions