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.). 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?

<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL> <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>

 DSSSList info and archive:

Current Thread