Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support semicolon, i.e. @load_preference(key; default = nothing)? #5

Closed
DilumAluthge opened this issue Jan 4, 2021 · 3 comments
Closed

Comments

@DilumAluthge
Copy link
Member

DilumAluthge commented Jan 4, 2021

This:

@load_preference(key; default = nothing)

Gives the following error:

ERROR: LoadError: LoadError: syntax: invalid syntax ; default = nothing

In contrast, this works just fine:

@load_preference(key, default = nothing)

Would it be possible to support the version of the syntax with the semicolon (i.e. @load_preference(key; default = nothing)? It would be consistent with one of the main ways of using keyword arguments in functions.

@DilumAluthge
Copy link
Member Author

Bump @staticfloat

@staticfloat
Copy link
Member

Hmmm, can macros do that?

@DilumAluthge
Copy link
Member Author

ERROR: syntax: macros cannot accept keyword arguments

Hmmm, apparently not.

It's weird, because the syntax @load_preference(key, default = nothing) doesn't seem like a positional argument. But it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants