[racket-dev] An implementation of 'case' based on Clinger's "Rapid Case Dispatch in Scheme"

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Mon Jul 23 20:10:23 EDT 2012

On Mon, Jul 23, 2012 at 7:57 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> This is really nicely done --- thanks!
> I've added your patch to the main repo.
> Then I made small changes:
>  * changed to generate vector and hash-table constants, instead of
>    using `vector' and `make-hasheq', since the compiler and bytecode
>    format deal better with constants;
>  * removed the specialization of `eqv?' to `eq?' for some constants,
>    because the bytecode compiler should take care of that (and covers
>    more cases);
>  * changed the handling of "other" constants to be like symbols and
>    keywords, but using an `eqv?'-based hash table; and
>  * reduced the symbol-or-keyword check that guarded a hash table
>    lookup to use only `symbol?' if only symbols are mapped, etc.
> You may want to double-check those changes.

Thanks! I wasn't aware you could syntax-unquote a vector or a
hashtable to produce a constant. That's good to know.

Posted on the dev mailing list.