On 8/21/2019 3:25 PM, Jon Zeppieri wrote:
Racket's `case` is an implementation of this approach:
http://scheme2006.cs.uchicago.edu/07-clinger.pdf
It is not significantly complicated by `else`. And that approach was
created in the context of Scheme, which leaves the return value
unspecified when none of the tests are successful. That seems like it
should offer more opportunities for optimization, but I don't think
this approach is any less efficient when the unsuccessful result is
specified as #<void> (as it is in Racket) than when it is not.
- Jon
Thanks for the pointer!
'case' in Scheme is an interesting challenge for compilation because it
can involve dispatching on multiple types, each having its own
comparison ordering. I would hope that Racket leverages generic table
searches where possible - depending on the use, generating a complete
static dispatch routine everywhere can result in explosive growth of the
code. [Not that I've seen this happen, but I haven't had occasion to
experiment in Racket with extremely large or complicated 'case'
constructs.]
George
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/a8dd208d-dd3f-a2a7-3d20-3c1027932ac9%40comcast.net.