[racket-dev] 'case' using equal?

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Sun Nov 25 18:33:25 EST 2012

As a follow-up to the discussion on the users list
[http://lists.racket-lang.org/users/archive/2012-November/054973.html],
I changed 'case' to use equal? comparison.

The diff, including additional tests and a doc change, is at
[https://github.com/97jaz/racket/commit/731db72e8b9ddcba7b443478666cc278d2a898d0].

Performance on Clinger's benchmarks has improved since the last time I
checked, even with the equal? change, so this must be due to unrelated
optimization work.

I did not implement the string optimization I mentioned in the thread
on the users list. It occurred to me that (a) using string->symbol on
the input would allocate if the symbol hadn't already been interned
(which may come as a surprise to the user), and (b) the user probably
ought to expect lexicographic equality tests if he uses strings,
anyway.

-Jon

Posted on the dev mailing list.