-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow juxtaposition of macro and array literal. fixes #23519 #23547
Conversation
4b776b8
to
17ec447
Compare
Implementation looks fine to me. |
What you've noted in the docs, that |
Yes, unfortunately, it adds yet another gotcha, along with From my experience, my brain defaults to already interpret This desire for a lightweight syntax for "non-standard array literals" comes mainly from static arrays, where, possibly unlike to other custom arrays, it is very common to need small literal arrays with constructors as performant as possible. Indeed StaticArrays is all about the performance of small matrices where stuff like construction, indexing, etc. (and their optimization/inlining) tends to be as much important as matrix algebra and iteration. Also, array literals (excluding concatenations and comprehension) are used almost always for small matrices! Many discussions have been taken about a more lightweight syntax for custom array literals (notice that array elements don't have to be literal numbers). I referred some in #23519, and another important one happens JuliaArrays/StaticArrays.jl#24 . The syntax change I'm proposing is a very low-hanging fruit for "something reasonabe". |
dfe96c3
to
880aff7
Compare
Rebased. |
Some people have shown dislike and some people have shown sympathy for this change, both here and in the issue (#23519). How usually are these cases resolved? I think that it is better to either merge or reject the PR, right? |
It can sometimes be a slow process, @cdsousa. If you want resolution, I'll add some labels which means it will be picked up by what's being called the "triage" process. |
@ararslan The fact that
doesn't seem worse than the fact that |
Needs news, then I will merge this. |
This is an attempt to implement what I have suggested in #23519:
interpret
@foo[1, 2, 3]
as@foo([1, 2, 3])
.I have almost (now) zero knowledge of scheme, so pardon me if the implementation is too wrong.
It seems to work ok in many situations,
but it doesn't have any test yet.