-
-
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
fix slurping into function definition #40738
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Discovered while working on #40737. Currently, this throws an unintuitive error: ```julia julia> a, f()... = 1, 2, 3 ERROR: syntax: ssavalue with no def Stacktrace: [1] top-level scope @ REPL[1]:1 ``` Might as well fix this properly - Why not allow function definitions to slurp a little from time to time? ;)
simeonschaub
added
the
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
label
May 6, 2021
Not claiming it's necessarily all that useful, but I think this is pretty cool at least: julia> x = [1, 2, 3];
julia> _, f()... = x;
julia> f()
2-element Vector{Int64}:
2
3
julia> x[3] = 4;
julia> f()
2-element Vector{Int64}:
2
4 |
Bump. |
JeffBezanson
approved these changes
Jun 30, 2021
Seems unhappy with some merge conflict? |
Might be related to #40737, will look into it. |
Yes, the example linked above now doesn't close over |
johanmon
pushed a commit
to johanmon/julia
that referenced
this pull request
Jul 5, 2021
Discovered while working on JuliaLang#40737. Currently, this throws an unintuitive error: ```julia julia> a, f()... = 1, 2, 3 ERROR: syntax: ssavalue with no def Stacktrace: [1] top-level scope @ REPL[1]:1 ``` Might as well fix this properly - Why not allow function definitions to slurp a little from time to time? ;)
KristofferC
pushed a commit
that referenced
this pull request
Jul 7, 2021
Discovered while working on #40737. Currently, this throws an unintuitive error: ```julia julia> a, f()... = 1, 2, 3 ERROR: syntax: ssavalue with no def Stacktrace: [1] top-level scope @ REPL[1]:1 ``` Might as well fix this properly - Why not allow function definitions to slurp a little from time to time? ;) (cherry picked from commit 5c49a0d)
82 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Discovered while working on #40737. Currently, this throws an
unintuitive error:
Might as well fix this properly - Why not allow function definitions to
slurp a little from time to time? ;)