[e-lang] Re "Rapid Case Dispatch in Scheme"
Kevin Reid
kpreid at mac.com
Fri Sep 29 15:25:45 CDT 2006
From our discussion <http://meme.b9.com/cview.html?
channel=erights&date=060928>:
> 05:46:56 <markm_> http://scheme2006.cs.uchicago.edu/07-clinger.pdf
> - "Rapid Case Dispatch in Scheme" by Clinger
...
> 06:51:36 <kpreid> markm: the case dispatch paper seems not to cover
> implementation details of the clause index to code part
> 06:52:01 <kpreid> true or did I miss something?
> 06:52:06 <kpreid> the "Related Work" section seems to list
> everything they *don't* do
> 06:52:21 <markm_> I'll have to take a closer look soon. (I've only
> skimmed so far.)
I have now found the part I was missing in the paper:
> 2. Implementation
> ...
> The basic idea can be seen in figure 1:
> ...
> 3. Use binary search on the clause index to select the
> expressions to be evaluated for that clause.
This can be seen in the code in figure 3, but in a sufficiently
simple form that I didn't recognize it:
(if (<:fix:fix n 1)
(f-other x)
(if (<:fix:fix n 2)
(f-vowel x)
(f-consonant x)))
That is, a binary search with all branches written out explicitly.
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list