>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)srce.hr> writes:
Hrvoje> But who cares about that? You're not supposed to be
Hrvoje> relying on the value char-int returns, right? Right. The
> Well, yes, but in practice people do rely on that value;
Hrvoje> Who, and what for?
The byte-compiler uses it in couple of places, subr.el uses it I
think, w3.el uses it a lot. (I'm upgrading the system where my notes
are, I can't say more off hand.)
ucs-conv has a file or two that don't use much of anything else.
> often that value being more reliable than a true character is
> the reason they use it.
Hrvoje> How can it be more reliable than the "true character"?
Dunno. I haven't really started tracking it down yet. That's a
paraphrase of a comment in bytecode.el or somesuch.
> I would be happy to break char-int and int-char beyond repair,
> personally, and spend the effort to make characters reliable.
Hrvoje> I understand and concur with the latter sentiment, but not
Hrvoje> with the former. Sorry.
I don't see _any_ appropriate use for those myself. Characters taken
out of their locales are not integers: they are at best partially
ordered (and in Unicode not even close), none of the arithmetic
operations make sense, etc. And vice-versa; the operation `toupper'
cannot be sensibly applied to integers. Any time those casts are used
for anything but pure voyeurism (examining the internal
representation), there's a flaw in the API.
In practice, of course we need to support casts so that people can
implement new operations on characters in Lisp. I'm not serious about
"beyond repair."
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
__________________________________________________________________________
__________________________________________________________________________
What are those two straight lines for? "Free software rules."