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

Default values for macros #9627

Closed
hayd opened this issue Jan 5, 2015 · 2 comments · Fixed by #14563
Closed

Default values for macros #9627

hayd opened this issue Jan 5, 2015 · 2 comments · Fixed by #14563
Labels
needs decision A decision on this change is needed parser Language parsing and surface syntax

Comments

@hayd
Copy link
Member

hayd commented Jan 5, 2015

The following syntax doesn't work for macros (but does for functions):

julia> macro foo(a, b::Bool=true)
          a, b
       end
ERROR: syntax: "(kw (:: b Bool) #t)" is not a valid function argument name

julia> function foo(a, b::Bool=true)  #works for functions
          a, b
       end
foo (generic function with 2 methods)

julia> foo(1)
(1,true)
@IainNZ IainNZ added the feature label Jan 5, 2015
@ihnorton ihnorton added needs decision A decision on this change is needed parser Language parsing and surface syntax labels Jan 6, 2015
@ihnorton
Copy link
Member

ihnorton commented Jan 6, 2015

Seems unnecessary IMHO (varargs work fine), but I guess it is arguably more consistent. The error message could at least be improved.

@JeffBezanson
Copy link
Sponsor Member

This is basically a duplicate (or special case) of #8846.

JeffBezanson added a commit that referenced this issue Jan 4, 2016
fix #9627, fix #8846, fix #8701
helps #3377, but additional work is needed there
JeffBezanson added a commit that referenced this issue Jan 5, 2016
fix #9627, fix #8846, fix #8701
helps #3377, but additional work is needed there
JeffBezanson added a commit that referenced this issue Jan 5, 2016
fix #9627, fix #8846, fix #8701
helps #3377, but additional work is needed there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision A decision on this change is needed parser Language parsing and surface syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants