Re: Using (CASE ...) with strings?
- From: Ken Tilton <kentilton@xxxxxxxxx>
- Date: Sun, 29 Oct 2006 15:48:34 -0500
J.C. Roberts wrote:
#|
It seems I'm misunderstanding HyperSpec when it comes to the (CASE ...) macro.
http://www.lisp.org/HyperSpec/Body/mac_casecm_ccasecm_ecase.html#case
I _think_ it is supposed to evaluate the keyform and then compare the
result to the keys of the successive normal-clauses until it finds a match (i.e with "the same" as defined by http://www.lisp.org/HyperSpec/Body/glo_s.html#same)
"same adj. 1. (of objects under a specified predicate) indistinguishable by that predicate. ``The symbol car, the string "car", and the string "CAR" are the same under string-equal''. 2. (of objects if no predicate is implied by context) indistinguishable by eql."
Notice that eql is the default, and...
(CASE ...) works fine when used with numbers or symbols but what I don't understand is why it fails miserably on strings?
..... (eql "aa" "aa") -> NIL
kt
--
Cells: http://common-lisp.net/project/cells/
"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
.
- Follow-Ups:
- Re: Using (CASE ...) with strings?
- From: jjjacobson
- Re: Using (CASE ...) with strings?
- Prev by Date: Re: newbie request for lisp webapp project idea
- Next by Date: Re: Using "internal" macros of a CL implementation
- Previous by thread: Re: logo design
- Next by thread: Re: Using (CASE ...) with strings?
- Index(es):
Relevant Pages
|