[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ?\_ patch

From: Kim F. Storm
Subject: Re: ?\_ patch
Date: 07 Feb 2003 16:51:01 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Miles Bader <address@hidden> writes:

> On Fri, Feb 07, 2003 at 03:52:02PM +0100, Kim F. Storm wrote:
> > > Because #\SPC is actually pretty self-explanatory whereas ?\s isn't.
> > 
> > IMO, \s is just as self-explanatory as \t, \n, and \r.
> The latter are `self-explanatory' only because they're used in C, and so are
> very familar to programmers.  \s is not.

The Lisp manual doesn't refer to C syntax to explain e.g. ?\t.
So to me, \s and \t are equally self-explanatory.

On the other hand, I don't find #\SPC self-explanatory (but ?\SPC is).

> > > I thought about that too, but I think #\SPC is better, because the `\'
> > > leaves a bit of whitespace between itself and the following character so
> > > the `SPC' stands out quite distinctly.  `?' on the other isn't visually
> > > distinct, so #?SPC looks like a bit of a muddle.
> > 
> > Then what about simply using ?SPC, ?TAB, etc.
> No, you're missing the point.  My object to `?' is that the `?' is not
> visually distinct from the `S' -- they tend to `run into' each other. 
> `\', on the other hand has a bunch of whitespace on the right side of it's
> glyph, and so is much more visually distinct from the following character.

Ok, I agree.  However, I still think it is best to keep the ? as part
of the read syntax for a character, i.e. I prefer ?\SPC to #\SPC as
the ?\ prefix clearly identifies this as a character, e.g. I find the
use of ? in the following example more consistent than #:

        (memq ch '(?\SPC ?\- ?\n ?\t))
        (memq ch '(#\SPC ?\- ?\n ?\t))

I just grepped for "[?][\\][A-Z][^-]" in all of lisp/ and there isn't
a single occurrence.  So the ?\XXX syntax should be safe.

> Morever, `#' is _good_ becaues it's the general lisp syntax for special
> syntax, so a lisp programmer will be much more likely to realize what's going
> on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
> than if he sees ?SPC.

But `?' is _much better_ than `#' here, since _any_ lisp programmer
should know that this denotes a character, whereas `#' just denotes it
as "special" (but there's nothing special about a space character?).

I vote for ?\SPC over #\SPC.

But I still think adding ?\s is the best choice; it's simple, it
doesn't break anything, and it doesn't require us to introduce a
completely new character syntax.

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]