diff --git a/README.md b/README.md index ef1833c..abd33af 100644 --- a/README.md +++ b/README.md @@ -514,10 +514,9 @@ The keyword `in` is used consistently instead of `∈` and `=` in `for` loops. E +for i in 1:2 ``` -#### Potential changes - - Since `∉` exists the formatted code may become asymmetric, when both `∈` and `∉` are - used, since `∉` is left alone and not replaced by e.g. `!(...)`. See discussion in issue - [#17](https://github.com/fredrikekre/Runic.jl/issues/17). +Note that `∈` not replaced when used as an operator outside of loop contexts in +order to be symmetric with `∉` which doesn't have a direct ASCII equivalent. +See [#17](https://github.com/fredrikekre/Runic.jl/issues/17) for more details. ### Braces around right hand side of `where` diff --git a/test/runtests.jl b/test/runtests.jl index 6364170..2761508 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -467,6 +467,11 @@ end "$(l)i for i in I, j in J if i < j$(r)" end end + # ∈ is still allowed when used as an operator outside of loop contexts in order to keep + # symmetry with ∉ which doesn't have a direct ascii equivalent. + # See https://github.com/fredrikekre/Runic.jl/issues/17 + @test format_string("a ∈ A") == "a ∈ A" + @test format_string("a ∉ A") == "a ∉ A" end @testset "braces around where rhs" begin