Re: Capitalizing a string?

Subject: Re: Capitalizing a string?
From: Chris Maden <crism@xxxxxxxxxxx>
Date: Thu, 10 Dec 1998 15:57:28 -0500 (EST)
[Russell Steven Shawn O'Connor]
> (define (char-upcase ch)
>         (cond ((char=? #\a ch) #\A)
>               ((char=? #\b ch) #\B)
[...]

Can someone explain why this is better than using (case)?

(case ch
      ((#\a) #\A)
      ((#\b) #\B)
...)

The char=? procedure seems only to have been included in DSSSL for
completeness with language-dependent ordering procedures (char<?
etc.).  8.5.8.4 explicitly states that char=? is independent of the
current language.  Am I missing something?

I prefer to use (case) over (cond) when possible.  So if there's no
difference between the two methods above, is there an implementation
reason for using one or the other?  Or will a good processor equate
the two anyway?

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread