ASCII bracket procedures Lassi Kortela (20 Sep 2019 10:03 UTC)
Re: ASCII bracket procedures John Cowan (20 Sep 2019 10:49 UTC)
Re: ASCII bracket procedures Lassi Kortela (20 Sep 2019 11:34 UTC)
Re: ASCII bracket procedures Lassi Kortela (20 Sep 2019 11:38 UTC)
Re: ASCII bracket procedures Lassi Kortela (20 Sep 2019 14:04 UTC)

Re: ASCII bracket procedures Lassi Kortela 20 Sep 2019 14:04 UTC

>>> (ascii-opening-bracket char) => char or #f
>>> (ascii-closing-bracket char) => char or #f
>>> (ascii-opposing-bracket char) => opposing-char or #f
>
>>> I suggest going with Unicode terminology and conventional predicates:
>>> ascii-open-punctuation?, ascii-close-punctuation?, and
>>> ascii-mirroring-character.  Not quite as terse, perhaps, but more
>>> familiar.
>
> I believe they are only more familiar to Unicode experts :) "Bracket" is
> almost universal slang, even known by laypeople, for any kind of
> parenthetical symbol with an opposite pair. And the only mirroring
> punctuation in the ASCII range are the four kinds of brackets. "Bracket"
> is also a shorter and less abstract word than "punctuation".
>
> However, "mirroring-bracket" is just as good as "opposing-bracket", so I
> can change it without further ado. It's only one character longer too.
>
> "Opening" and "closing" are words of the same length so I preferred them
> even though "open" and "close" are shorter. No strong opinion here.

It seems the words in the Unicode terminology are in reverse order:
"Punctuation, Open" and "Punctuation, Close". Those category names are
hard to find, too. Even the Unicode consortium's own character browser
doesn't say them. A web search for "open punctuation" gives advice on
how to write formal business letters, and "close punctuation" gives
something about full-stops and such. So the terminology is of no help to
confused charset plebs like me.

According to my confused web searches, the terminology "mirror" vs
"mirroring" doesn't seem stable either. So I would prefer "mirror" which
is shorter and easier to spell.

If I add the procedures using the names:

* ascii-open-bracket
* ascii-close-bracket
* ascii-mirror-bracket

Is this a good enough compromise?

Wrote the implementations and tested them from the REPL; they are quite
nice to use, whatever the names.