Hello, I am using Julia 1.10.4 and I am confused about the variable keyword arguments place.
According to this from the docs:
The nature of keyword arguments makes it possible to specify the same argument more than once. For example, in the call
plot(x, y; options..., width=2)
it is possible that theoptions
structure also contains a value forwidth
. In such a case the rightmost occurrence takes precedence; in this example,width
is certain to have the value2
. However, explicitly specifying the same keyword argument multiple times, for exampleplot(x, y, width=2, width=3)
, is not allowed and results in a syntax error.
we can see that the variable kwargs are used before the final position, however when I use them before the final position an error occur ?
function everything(x, k = 1, y...; z..., j = "Hello")
println(x)
println(y)
println(k)
println(z)
println(z...)
end
everything(15,16,20,21,22;v1 = 1, v2 =2)
I get the error:
syntax: invalid "..." on non-final keyword argument