[Grace-core] Parsing ambiguity

Michael Homer mwh at ecs.vuw.ac.nz
Tue Jul 1 23:56:28 PDT 2014


On Wed, Jul 2, 2014 at 6:47 PM, Michael Homer <mwh at ecs.vuw.ac.nz> wrote:
> On Wed, Jul 2, 2014 at 6:37 PM, Kim Bruce <kim at cs.pomona.edu> wrote:
>> I've always preferred [ ] (which should now be available as we change lists) or even [[ ]].  "<" and ">" are just too common and will cause confusion even if we make arbitrary rules like requiring whitespace around relations.
> [] lists have never been part of the language and so cannot change. []
> indexing is in the specification¹ (§8.5, "Accessing Operator
> Requests"), which is totally undisambiguable from [] for generics.
For additional bracketing choices, there is as ever Perl 6 to look at.
It permits [1] paired characters from Unicode classes "Punctuation,
Open" (Ps) and "Punctuation, Close" (Pe):
    ( [ { ༺ ༼ ᚛ ‚ „ ⁅ ⁽ ₍ ⌈ ⌊ 〈 ❨ ❪ ❬ ❮ ❰ ❲ ❴ ⟅ ⟦ ⟨ ⟪ ⟬ ⟮ ⦃ ⦅ ⦇ ⦉ ⦋ ⦍
⦏ ⦑ ⦓ ⦕ ⦗ ⧘ ⧚ ⧼ ⸢ ⸤ ⸦ ⸨ ⹂ 〈 《 「 『 【 〔 〖 〘 〚 〝 ﴿ ︗ ︵ ︷ ︹ ︻ ︽ ︿ ﹁ ﹃ ﹇ ﹙
﹛ ﹝ ( [ { ⦅ 「
and
    ) ] } ༻ ༽ ᚜ ⁆ ⁾ ₎ ⌉ ⌋ 〉 ❩ ❫ ❭ ❯ ❱ ❳ ❵ ⟆ ⟧ ⟩ ⟫ ⟭ ⟯ ⦄ ⦆ ⦈ ⦊ ⦌ ⦎ ⦐ ⦒
⦔ ⦖ ⦘ ⧙ ⧛ ⧽ ⸣ ⸥ ⸧ ⸩ 〉 》 」 』 】 〕 〗 〙 〛 〞 〟 ﴾ ︘ ︶ ︸ ︺ ︼ ︾ ﹀ ﹂ ﹄ ﹈ ﹚ ﹜ ﹞
) ] } ⦆ 」
, and "Punctuation, Initial quote" (Pi) and "Punctuation, Final quote" (Pf):
    « ‘ ‛ “ ‟ ‹ ⸂ ⸄ ⸉ ⸌ ⸜ ⸠
and
    » ’ ” › ⸃ ⸅ ⸊ ⸍ ⸝ ⸡
Maybe you can pick some of the more obvious pairs of those to use for
less common scenarios.
-Michael
[1] http://perlcabal.org/syn/S02.html#Bracketing_Characters



More information about the Grace-core mailing list