[gambit-list] (case)
Marc Feeley
feeley at iro.umontreal.ca
Fri Oct 31 10:03:20 EDT 2008
On 31-Oct-08, at 9:48 AM, Christoph Bauer wrote:
> thanks for all the responses in the string->number thread. I have
> another question: what is the correct result of
>
> (case ".ab" ((".ab") 1) (else 2))
>
> Indeed gsi gives another answer as scheme48. (maybe eq? vs equal?)
Case uses eqv? to compare the keys, and given that here (eqv? ".ab"
".ab") is normally #f, the else clause is executed. Note that (eqv?
".ab" ".ab") could be #t if compiled by a compiler that merges
constants (Scheme48 seems to do this and Gambit used to do this, and
may in the future). In any case in Scheme (eqv? ".ab" ".ab") is
either #t or #f.
Marc
More information about the Gambit-list
mailing list