From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news2.kpn.net!news.kpn.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Char ordering. References: Mail-Copies-To: never From: Erik Naggum Message-ID: <3224594886419204@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 29 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Mar 2002 16:47:57 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1015606077 193.71.199.50 (Fri, 08 Mar 2002 17:47:57 MET) NNTP-Posting-Date: Fri, 08 Mar 2002 17:47:57 MET Xref: archiver1.google.com comp.lang.lisp:28140 * Jacek Generowicz | I want to write a function which converts the letters a-z (lower or | uppercase) to the integer 0; f,g,h,j,k (note absence of i) to the | integer 1; l-p to 2; q-u to 3 and v-z to 4. | | Ignoring the annoyance of the missing i, a floor operation, and an | upcase, this boils down to mapping the letters to consecutive numbers. Huh? | The spec tells me that partial ordering of characters is guaranteed, but | points out that contiguity is not. So? Who cares? | How should I go about writing this function in an implementation | independent way ? (case (char-upcase char) ((#\A #\B #\C #\D #\E) 0) ((#\F #\G #\H #\J #\K) 1) ((#\l #\m #\n #\o #\p) 2) ((#\Q #\R #\S #\T #\U) 3) ((#\V #\W #\X #\Y #\Z) 4)) /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.