Martin Buchholz <martin(a)xemacs.org> writes:
> Hrv> This is not Ebola. Ebola is code like:
>
> Hrv> (if (eq <char> <integer>)
> Hrv> ...
>
> Well, now I'm confused.
>
> Comparisons on Numbers
>
> Each of the functions in this section requires that its arguments
> all be numbers; to call one with a non-number is an error. Unless
> otherwise specified, each works on all types of numbers,
> automatically performing any required coercions when arguments are
> of different types.
This is, I assume, Common Lisp? Because in XEmacs Lisp characters and
markers are also allowed:
In addition to numbers, all of the following functions also accept
characters and markers as arguments, and treat them as their
number equivalents.
What "number equivalent" means is open for debate, but equality should
remain well-defined in those terms.
> There's the function char=, which kind of sounds like it does what
> you want, but...
char= is all nice, but then we'd also need char<, char>, char<= etc.
That sounds ugly. How does CL collate characters?
> {
> CHECK_CHAR_COERCE_INT (c1);
> CHECK_CHAR_COERCE_INT (c2);
>
> return XCHAR(c1) == XCHAR(c2) ? Qt : Qnil;
> }
>
> Note how the documentation and the implementation don't match.
Fixable by changing CHECK_CHAR_COERCE_INT to CHECK_CHAR.
> Also note how the optional third buffer argument really sucks here.
Totally.