-
-
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
iteration variables should be local to comprehensions #547
Comments
See also #524 for scoping in list comprehensions at the REPL. What does your example do if you embed it in a function, making
|
Okay, this does look like something different, then.
|
Congratulations, you found a compiler bug :) |
It's maybe not ideal, but you can accomplish this as:
|
Okay, with that out of the way, it looks like there's three separate issues here:
The same thing happens with enclosing function definitions. (2) Request that list comprehensions support filters/guards as in Haskell or Python. My Scheme reading abilities aren't terribly good but it doesn't look like that's in there. I agree it would be nice. I've spun this into #550. And Jeff is working faster than I can type this. (3) Request for support for Unicode forms for certain operators. Editor and REPL support would be required to make this practical for people with normal keyboards. The Haskell editor Yi supports certain automatic Unicode replacements (see https://github.com/yi-editor/yi/blob/master/yi/src/library/Yi/Char/Unicode.hs). Given how few special operators exist in the language I'm not sure how useful this is overall. There's |
to unicode: I'm supprised this works: julia> π=3.141 julia> r=5 julia> 円=π_r_r awesome. |
Of course that works! :) |
Since we have issues for the other parts of this, I'm going to change the title of this one. |
This examples doesn't work... Am I missing something?
|
We've used |
Thanks @JeffBezanson I was using |
Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: e61663a New commit: 55976a6 Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @ViralBShah Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@e61663a...55976a6 ``` $ git log --oneline e61663a..55976a6 55976a6 Keep sparse solvers docs as before (#552) 95fd7ff Missing space in error message (#554) b8a13ef implement in-place `ldiv!` for Cholesky factorization (#547) 1527014 Do not use nested dissection by default. (#550) ``` Co-authored-by: Dilum Aluthge <[email protected]>
…aLang#55469) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: e61663a New commit: 55976a6 Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @ViralBShah Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@e61663a...55976a6 ``` $ git log --oneline e61663a..55976a6 55976a6 Keep sparse solvers docs as before (JuliaLang#552) 95fd7ff Missing space in error message (JuliaLang#554) b8a13ef implement in-place `ldiv!` for Cholesky factorization (JuliaLang#547) 1527014 Do not use nested dissection by default. (JuliaLang#550) ``` Co-authored-by: Dilum Aluthge <[email protected]>
x==10 is true
I think that's strange. x should be a local variable in that loop. Also Haskell style comprehensions are cool. On the one hand like map:
On the other hand more powerful:
I 'd love unicode keywords (as valid alternative form), but i guess nobody else does.
The text was updated successfully, but these errors were encountered: