[racket] case form implemented with a hash

From: Jos Koot (jos.koot at telefonica.net)
Date: Wed Sep 28 16:08:44 EDT 2011

By inspection with the macro stepper I found that case forms are expanded to
nested if-forms. For case forms with many clauses, this may be inefficient.
I have tried to prepare a hash-case form using a hash table in order to
select the desired clause more efficiently. So far my attempts failed. I am
still trying. However, has anybody else on this list thought of using a hash
for case forms with many clauses? Does it exist? If not, would anyone be
interested in a hash-case form that has the same shape as a case-form, but
uses a hash-table to select the appropriate clause? The hash table should be
a map onto thunks and macro hash-case simply would have to retrieve the
thunk and call it.
Thanks, Jos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110928/3350d134/attachment.html>

Posted on the users mailing list.