# Rationale behind excluding some unicode characters from identifiers

**URL:** <https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509>\
**Category:** Internals & Design\
**Created:** [March 3, 2023, 4:37pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509 "2023-03-03T16:37:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 3, 2023, 4:37pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/1 "2023-03-03T16:37:47Z")

</div>

I’m wondering why some Unicode punctuation characters (Open Punctuation Ps, and Close Punctuation Pe) were [excluded from variables names](https://github.com/JuliaLang/julia/blob/48b4caaf94c6dcfc9d28e9929ebb27d480b7b6cc/src/flisp/julia_extensions.c#L191-L200) (identifiers) in [this PR](https://github.com/JuliaLang/julia/pull/30595).

```julia
julia> ❘u❘ = abs(u) # allowed, e.g. denote an absolute value
julia> ⟦u⟧ = 1 # why not ? my use case is denoting a jump
ERROR: syntax: invalid character "⟦" near column 1
julia> ⦃u⦄ = 1 # why not ? my use case is denoting an average
ERROR: syntax: invalid character "⦃" near column 1

```

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 3, 2023, 4:43pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/2 "2023-03-03T16:43:49Z")

</div>

one or more of the following:

- too subtle
- too confusing
- too obscure (user may not know what the heck this symbol means or called or how to type it, sure, can use Julia REPL, but com’on)

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [March 3, 2023, 4:48pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/3 "2023-03-03T16:48:41Z")

</div>

The slightly more detailed answer is that the parser needs to know whether a character is part of a name or if it is an operator. (e.g. you can’t name a variable `a⊂`). As such we only add Unicode characters on request.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 3, 2023, 4:48pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/4 "2023-03-03T16:48:41Z")

</div>

That’s not my question. There are a lot of other Unicode characters that lead to ambiguities and still allowed (difficult to distinguish because of the current font, close to another: it’s the responsibility of the developer to use them sparingly), but I’m interested in knowing why these specific characters were excluded.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 3, 2023, 4:56pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/5 "2023-03-03T16:56:41Z")

</div>

Thanks, so they might be reserved for future operator usage (conservative choice).  
So what would be the criterion for such a request to be accepted ?

---

<div class="post-metadata">

**Author:** ![annoporci](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@annoporci](https://discourse.julialang.org/u/annoporci)\
**Post date:** [March 3, 2023, 4:57pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/6 "2023-03-03T16:57:12Z")

</div>

If they’re added on requests, request it: if it is rejected, you’ll know why!

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [March 3, 2023, 5:38pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/7 "2023-03-03T17:38:29Z")

</div>

yeah. Just open an issue and if there aren’t problems someone will probably add them to the list.

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [March 3, 2023, 6:38pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/8 "2023-03-03T18:38:10Z")

</div>

I want to use various fancy brackets as constructors for fancy container objects, so I wouldn’t want them to be in identifiers, just like `[](){}` aren’t in identifiers.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 3, 2023, 6:39pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/9 "2023-03-03T18:39:33Z")

</div>

Do you have an example ?

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [March 3, 2023, 6:51pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/10 "2023-03-03T18:51:04Z")

</div>

For example, if I could define

```julia
⦃1,2,2,3⦄ == MultiSet([1,2,2,3])

```

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 3, 2023, 6:52pm UTC](https://discourse.julialang.org/t/rationale-behind-excluding-some-unicode-characters-from-identifiers/95509/11 "2023-03-03T18:52:13Z")

</div>

I’ve opened [[FR] Allow more Unicode characters from `Ps` and `Pe` categories for identifiers · Issue #48885 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/48885) and [Allow more Unicode characters from `Ps` and `Pe` categories for identifiers by t-bltg · Pull Request #48886 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/48886), to be discussed.
