File tree 4 files changed +20
-4
lines changed
4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ Julia v0.5.0 Release Notes
4
4
New language features
5
5
---------------------
6
6
7
+ * `x ∈ X` is now a synonym for `x in X` in `for` loops and comprehensions,
8
+ as it already was in comparisons ([#13824]).
9
+
7
10
Language changes
8
11
----------------
9
12
@@ -1589,6 +1592,7 @@ Too numerous to mention.
1589
1592
[#7917]: https://github.com/JuliaLang/julia/issues/7917
1590
1593
[#7992]: https://github.com/JuliaLang/julia/issues/7992
1591
1594
[#8011]: https://github.com/JuliaLang/julia/issues/8011
1595
+ [#8036]: https://github.com/JuliaLang/julia/issues/8036
1592
1596
[#8089]: https://github.com/JuliaLang/julia/issues/8089
1593
1597
[#8113]: https://github.com/JuliaLang/julia/issues/8113
1594
1598
[#8135]: https://github.com/JuliaLang/julia/issues/8135
@@ -1736,6 +1740,8 @@ Too numerous to mention.
1736
1740
[#13465]: https://github.com/JuliaLang/julia/issues/13465
1737
1741
[#13496]: https://github.com/JuliaLang/julia/issues/13496
1738
1742
[#13480]: https://github.com/JuliaLang/julia/issues/13480
1743
+ [#13496]: https://github.com/JuliaLang/julia/issues/13496
1739
1744
[#13542]: https://github.com/JuliaLang/julia/issues/13542
1740
1745
[#13680]: https://github.com/JuliaLang/julia/issues/13680
1741
1746
[#13681]: https://github.com/JuliaLang/julia/issues/13681
1747
+ [#13824]: https://github.com/JuliaLang/julia/issues/13824
Original file line number Diff line number Diff line change @@ -483,8 +483,8 @@ See :ref:`man-variables-and-scoping` for a detailed
483
483
explanation of variable scope and how it works in Julia.
484
484
485
485
In general, the ``for `` loop construct can iterate over any container.
486
- In these cases, the alternative (but fully equivalent) keyword ``in `` is
487
- typically used instead of ``= ``, since it makes the code read more
486
+ In these cases, the alternative (but fully equivalent) keyword ``in ``
487
+ or ` ∈ ` is typically used instead of ``= ``, since it makes the code read more
488
488
clearly:
489
489
490
490
.. doctest ::
@@ -496,7 +496,7 @@ clearly:
496
496
4
497
497
0
498
498
499
- julia> for s in ["foo","bar","baz"]
499
+ julia> for s ∈ ["foo","bar","baz"]
500
500
println(s)
501
501
end
502
502
foo
Original file line number Diff line number Diff line change 1414
1414
r)
1415
1415
((eq? r ': )
1416
1416
r)
1417
- ((and (length= r 4 ) (eq? (car r) 'comparison ) (eq? (caddr r) 'in ))
1417
+ ((and (length= r 4 ) (eq? (car r) 'comparison )
1418
+ (or (eq? (caddr r) 'in ) (eq? (caddr r) '∈ )))
1418
1419
`(= ,(cadr r) ,(cadddr r)))
1419
1420
(else
1420
1421
(error " invalid iteration specification" )))))
Original file line number Diff line number Diff line change @@ -3485,6 +3485,15 @@ end
3485
3485
@test foo13855 (Base. AddFun ())() == Base. AddFun ()
3486
3486
@test foo13855 (Base. MulFun ())() == Base. MulFun ()
3487
3487
3488
+ # issue #8487
3489
+ @test [x for x in 1 : 3 ] == [x for x ∈ 1 : 3 ] == [x for x = 1 : 3 ]
3490
+ let A = Array (Int, 4 ,3 )
3491
+ for i ∈ 1 : size (A,1 ), j ∈ 1 : size (A,2 )
3492
+ A[i,j] = 17 * i + 51 * j
3493
+ end
3494
+ @test A == [17 * i + 51 * j for i ∈ 1 : size (A,1 ), j ∈ 1 : size (A,2 )]
3495
+ end
3496
+
3488
3497
# check if finalizers for the old gen can be triggered manually
3489
3498
# issue #13986
3490
3499
let
You can’t perform that action at this time.
0 commit comments