This happens in a tuple of expressions, when there is a semicolon that separates them:
julia> ex = :(a=1; b=2, c=3)
:(($(Expr(:parameters, :(b=2), :(c=3))), a = 1))
julia> dump(ex)
Expr
head: Symbol tuple
args: Array{Any}((2,))
1: Expr
head: Symbol parameters
args: Array{Any}((2,))
1: Expr
head: Symbol kw
args: Array{Any}((2,))
1: Symbol b
2: Int64 2
2: Expr
head: Symbol kw
args: Array{Any}((2,))
1: Symbol c
2: Int64 3
2: Expr
head: Symbol =
args: Array{Any}((2,))
1: Symbol a
2: Int64 1
julia> ex.args[1]
:($(Expr(:parameters, :(b=2), :(c=3))))
julia> ex.args[2]
:(a = 1)
I have failed to find the documentation of this. It seems as if it were to distinguish the keyword arguments (here called “parameters”) when the expressions are arguments of a function (or a macro?).
But if the parameters are the tail of the set of expressions, why is it that they are in the first place of args
?