wooks . wrote at 09/04/2010 04:22 PM:
(case "8"
  (("8" "9" "10") 'hello)
  (else 'goodbye)) -> goodbye

Unfortunately, you can't use "case" on strings, for somewhat esoteric reasons:

http://docs.racket-lang.org/reference/case.html
http://docs.racket-lang.org/reference/eval-model.html#(part._model-eq)

The R5RS document gives some more explanation and examples of what can be compared with eq/eqv/equal:

http://docs.racket-lang.org/r5rs-std/r5rs-Z-H-9.html#%_sec_6.1

You might find that "cond" or a hashtable can be used instead. Or maybe you don't actually need strings at this point in the code, and there is a better way to do it.

--
http://www.neilvandyke.org/
_________________________________________________
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/users

Reply via email to