JuliaLang/julia — pull request #8892 by tonyhffong (2014-11-03 20:14:49+00:00)
Title: [WIP] new brackets: angle, Angle, Brack, Brace

Relevant issue: https://github.com/JuliaLang/julia/issues/7128

I propose adding a number of unicode and composite brackets. In the table below, I include the new LaTeX shortcuts for these new brackets and how they will be parsed. As it stands now, these brackets can be used inside macros, but they have no meaning in proper Julia (yet). I have also given myself the creative license to equate `[| |]` to `⟦ ⟧` and `{| |}` to `⦃ ⦄`. I think they make input more pleasant, and visually their similarity is compelling.

The motivation is that we seem to struggle with using only three bracket types (), [], {} for a large number of language features.

LaTeX | ASCII | Parse Example1 | Parse Example2
--- | --- | --- | ---
\langle, \rangle | - | `⟨a,b⟩` -> `Expr(:angle,:a,:b)` | `foo⟨a⟩` -> `Expr(:anglecall,:foo,:a)`
\lAngle, \rAngle | - | `⟪a,b⟫` -> `Expr(:Angle,:a,:b)` | `foo⟪a⟫` -> `Expr(:Anglecall,:foo,:a)`
\lBrack, \rBrack | `[| |]` | `⟦a,b⟧` -> `Expr(:Brack,:a,:b)` | `foo⟦a⟧` -> `Expr(:Brackcall,:foo,:a)`
\lBrace, \rBrace | `{| |}` | `⦃a,b⦄` -> `Expr(:Brace,:a,:b)` | `foo⦃a⦄` -> `Expr(:Bracecall,:foo,:a)`

Notes and discussion points:

* How should Julia incorporate these new brackets in the language proper? I'd defer to the community to decide the use of these "scarce resources".
* I couldn't find a good way to 'ascii-fy' the angular brackets without stepping into dangerous edge cases.
* I have considered that `|: :|` being a bracket possibility as well. However, I notice that colon is used inside multiple contexts (range, symbol, quote, indexing wildcard) so there is also risk of surprise.