Julia: syntax: invalid macro usage 0.7

Created on 10 Jun 2018  路  2Comments  路  Source: JuliaLang/julia

I just recently found out, that you can actually do

@macro(args...) do x
    ...
end

Not on 0.7 anymore though:

julia> macro test(args...)
       println(args)
       end
julia> @test(test) do x
       println(x)
       end
ERROR: syntax: invalid macro usage "@(test(lol) do x
    # REPL[70], line 2
    println(x)
end)"

Is this a regression, or did this get removed?

parser regression

Most helpful comment

This is probably due to changing the parsing of do to preserve the do syntax, rather than parsing it like other function calls. I think it could be made to work again though.

All 2 comments

This is probably due to changing the parsing of do to preserve the do syntax, rather than parsing it like other function calls. I think it could be made to work again though.

Awesome, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m-j-w picture m-j-w  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

omus picture omus  路  3Comments

omus picture omus  路  3Comments

tkoolen picture tkoolen  路  3Comments