-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
TLDR: Please, allow parsing @foo[1, 2, 3]
as a shortcut for @foo([1, 2, 3])
.
Too many times, when using StaticArrays, I write stuff like
@SArray[1 2; 3 4] * v
which fails with ERROR: syntax: invalid macro use "@((typed_vcat SArray (row 1 2) (row 3 4)))"
I then add a space between @SArray
and [1 2; 3 4]
which also fails since the macro tries to consume the whole [1 2; 3 4] * v
expression.
The right way to do it
@SArray([1 2; 3 4]) * v
It would be nice to be able to this without the parentheses...
Yes, I know, it's not that cumbersome to type two extra characters... but on the other hand, this syntax is available and making it work will hopefully not introduce many accidental bugs.
This could be seen as a kind of "Non-Standard Array Literals".
(related: #8934, #7128, #6960, #8892, #7128)
(Had I the knowledge of Julia parser I would open a PR instead of an issue, but I'm a null at scheme.)