emacs-devel
[Top][All Lists]
Advanced

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

Re: Fwd: Re: Inadequate documentation of silly characters on screen.


From: Stephen J. Turnbull
Subject: Re: Fwd: Re: Inadequate documentation of silly characters on screen.
Date: Fri, 20 Nov 2009 11:43:42 +0900

Alan Mackenzie writes:

 > In XEmacs, characters and integers are distinct types.  That causes
 > extra work having to convert between them, both mentally and in writing
 > code.

Why do you have to convert?  The only time you need to worry about the
integer values of characters is (1) when implementing a coding system
and (2) when dealing with control characters which do not have
consistent names or graphic representations (mostly the C1 set, but
there are areas in C0 as well -- quick, what's the name of \034?)
When do you need to do either?

 > It is not that the GNU Emacs way is wrong, it just has a bug at the
 > moment.

I agree that equating the character type to the integer type is not
"wrong".  It's a tradeoff which we make differently from Emacs: Emacs
prefers code that is shorter and easier to write, XEmacs prefers code
that may be longer (ie, uses explicit conversions where necessary) but
is easier to debug because it signals errors earlier (ie, when a
function receives an object of the wrong type rather than when a user
observes incorrect display).

However, I think that allowing a given array of bytes to change type
from unibyte to multibyte and back is just insane.  Either the types
should be different and immutable (as in Python) or there should be
only one representation (multibyte) as in XEmacs.





reply via email to

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