Kinda a weird case, but I was thinking about how it'd be nice to be able to use the form (@foo x y) instead of @foo(x, y) to avoid having to write commas, but currently the parser demands that there's no whitespace in the middle of a macro arguments.
Maybe a more realistic example of where one might want to do this would be
julia> (@inline
function foo(x)
x + 1
end)
ERROR: ParseError:
# Error @ REPL[16]:2:1
(@inline
function foo(x)
└────────────┘ ── Expected `)`
Stacktrace:
[1] top-level scope
@ none:1
Is this something we could reasonably allow? I guess the worry is that it could alternatively be interpreted as (@foo(x); y) instead of (@foo(x, y)), but I think the parsing as (@foo(x, y)) is more consistent with how we handle infix operators, e.g.
Copying from https://github.com/JuliaLang/julia/issues/52842:
Minimal example:
Kinda a weird case, but I was thinking about how it'd be nice to be able to use the form
(@foo x y)
instead of@foo(x, y)
to avoid having to write commas, but currently the parser demands that there's no whitespace in the middle of a macro arguments.Maybe a more realistic example of where one might want to do this would be
Is this something we could reasonably allow? I guess the worry is that it could alternatively be interpreted as
(@foo(x); y)
instead of(@foo(x, y))
, but I think the parsing as(@foo(x, y))
is more consistent with how we handle infix operators, e.g.