Re: Using (CASE ...) with strings?





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
.



Relevant Pages

  • Re: How much intelligence?
    ... and I also think you'd agree that "car not car" is 100% false.Thus the ... think you need to define the mechanics you're using a little better. ... Without a verb no predicate. ... We learned to think logically from tautologies. ...
    (comp.ai.philosophy)
  • Re: How much intelligence?
    ... think you need to define the mechanics you're using a little better. ... That's why it takes one argument, a predicate, and inverts the truth ... We're talking apples and oranges again here, Tony. ... "it is a car" IS a predicate. ...
    (comp.ai.philosophy)
  • Re: How much intelligence?
    ... Without a verb no predicate. ... "it is a car" IS a predicate. ... Maybe if I understood the mechanics of your regressions I could comment on ... quantitative foundations, like geometry? ...
    (comp.ai.philosophy)
  • Re: How much intelligence?
    ... think you need to define the mechanics you're using a little better. ... That's why it takes one argument, a predicate, and inverts the truth ... We're talking apples and oranges again here, Tony. ... "it is a car" IS a predicate. ...
    (comp.ai.philosophy)
  • Re: How much intelligence?
    ... and I also think you'd agree that "car not car" is 100% false.Thus the ... think you need to define the mechanics you're using a little better. ... Without a verb no predicate. ... quantitative foundations, like geometry? ...
    (comp.ai.philosophy)