That's not special to macro-invocation. It's the default parsing of a
comma-separated list anywhere:

julia> 1,2,3
(1,2,3)

On Fri Jan 23 2015 at 10:19:49 PM Kirill Ignatiev <[email protected]>
wrote:

> I see nothing about this in
> http://julia.readthedocs.org/en/latest/manual/metaprogramming/#macro-invocation
>
> What's the logic behind reading macro arguments like this? Is it supposed
> to be this way? I found this syntax confusing.
>
> julia> macro test(args...); @show args; args[1]; end
>
> julia> @test 1, 2, 3, 4
> args = (:((1,2,3,4)),)
> (1,2,3,4)
>
> julia> @test 1 2, 3, 4
> args = (1,:((2,3,4)))
> 1
>
> julia> @test 1 2 3 4
> args = (1,2,3,4)
> 1
>
> julia> @test 1, 2 3 4
> args = (:((1,2)),3,4)
> (1,2)
>
> julia> @test 1, 2 3, 4
> args = (:((1,2)),:((3,4)))
> (1,2)
>
>

Reply via email to