VegaLite.jl icon indicating copy to clipboard operation
VegaLite.jl copied to clipboard

Support julia 1.5 keyword argument syntax: interpret @vlplot(; x, y) as @vlplot(x=x, y=y)

Open lassepe opened this issue 4 years ago • 1 comments

As of https://github.com/JuliaLang/julia/issues/29333 julia 1.5 supports implicitly named keyword arguments, e.g. f(; x, y) is interpreted as f(; x=x, y=y). It would be nice to support a similar syntax in the @vlplot macro. I at least find myself typing something like @vlplot(:line, width=width, height=height, x=x, y=y) quite often when writing functions that compose a custom spec for which I want to expose some properties as method arguments.

lassepe avatar Jul 10 '20 09:07 lassepe

We just need to be a bit careful how that interacts with our existing positional arguments. But maybe just allowing this after a semicolon would be one option.

davidanthoff avatar Jul 14 '20 18:07 davidanthoff