Hi All,
I have a question how to compare two symbols as follows:
> (setf a '(a b c d))
(A B C D)
> (char> (elt a 1) (elt a 2))
...some error messages...
Since (elt a 1) returns SYMBOL and char> is used to compare only characters.
I have no idea how I can compare these two symbols. I tried to find conversion
functions in case I can conver them to other types and compare, but still
cannot find it. Would you please give me suggestion in doing this.
Thank you in advance,
Pisut T.
In article <············@nunki.usc.edu>,
tranchin <········@nunki.usc.edu> wrote:
>Hi All,
> I have a question how to compare two symbols as follows:
>
> > (setf a '(a b c d))
> (A B C D)
> > (char> (elt a 1) (elt a 2))
> ...some error messages...
>
> Since (elt a 1) returns SYMBOL and char> is used to compare only characters.
>I have no idea how I can compare these two symbols. I tried to find conversion
>functions in case I can conver them to other types and compare, but still
>cannot find it. Would you please give me suggestion in doing this.
The following will probably do what you want:
(string> (elt a 1) (elt a 2))
The string functions are required to accept symbols, and automatically use
the symbol's name. To get precisely what you asked for, though, would
require:
(char> (char (symbol-name (elt a 1))) (char (symbol-name (elt a 2))))
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.