Re: Display, graphic, or printable characters?
Lassi Kortela 12 Nov 2019 11:53 UTC
>>>>> A character is "graphic" if it takes up room on the display surface: thus a
>>>>> letter, number, punctuation mark, symbol, combining character (none in
>>>>> ASCII), or any of Unicode's various space separator characters. It is
>>>>> "printable" if it also leaves ink on the display surface, which excludes
>>>>> the last group. (Unicode does not define "printable", but ISO C and C++
>>>>> do.)
>>>>
>>>> Based on BSD manual pages, isprint() is like isgraph() but also includes
>>>> the space character. isprint() does not include tab or newline.
>>>
>>> Right. Those move you around on the display surface as opposed to
>>> occupying it.
>>
>> I guess the distinction is somewhat moot nowadays on video displays, and
>> especially in GUIs. A tab's width is still N characters' width.
>>
>> The BSD graphic vs printable distinction is also swapped from your
>> explanation.
>
> Yes, sorry to confuse things further. Printable includes space characters,
> graphic excludes them. I checked more carefully this time.
No problem. Which name would you recommend for SRFI 175; will you be
using some of this terminology for Unicode procedures in R7RS-large?
I like the symmetry of "display" with Scheme's "display", and dislike
proliferating the word "print" for things that don't have anything to do
with paper printing / 3D printing (which is what laypeople think it is).
Then again, a procedure that checks for graphic characters _and_ space
is probably more useful than one that checks only for graphic chars.
Space is the only ASCII whitespace character that is "trivial to handle"
display-wise. Tab and newline bring small surprises; form feed and
vertical tab are just weird nowadays.
By using the word "display" we can weasel our way out of the
"print"/"printable" terminology and be more Scheme-like, but if you're
adding something like "char-graphic?" to -large, we'll have extra
terminology. Common Lisp has `graphic-char-p` as standard; it doesn't
have `printable-char-p`.
Common Lisp also uses the term "graphic character" in the way that you
and BSD use "printable character":
graphic adj. (of a character) being a ``printing'' or ``displayable''
character that has a standard visual representation as a single glyph,
such as A or * or =. Space is defined to be graphic. Of the standard
characters, all but newline are graphic. See non-graphic.
<http://clhs.lisp.se/Body/26_glo_g.htm#graphic>
"Cache invalidation and naming things."