From: tranchin
Subject: Need help: Symbol comparison?
Date: 
Message-ID: <6u0om4$olc$1@nunki.usc.edu>
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.
From: Barry Margolin
Subject: Re: Need help: Symbol comparison?
Date: 
Message-ID: <voSM1.26$45.568440@burlma1-snr1.gtei.net>
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.