<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Guido van Rossum wrote:
<blockquote
cite="midca471dc20606190737p2ca1ebf4m5091321b6d9ee2e@mail.gmail.com"
type="cite">
<pre wrap="">On 6/18/06, Josiah Carlson <a class="moz-txt-link-rfc2396E" href="mailto:jcarlson@uci.edu"><jcarlson@uci.edu></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">[...] Offering arbitrary expressions whose
meaning can vary at runtime would kill any potential speedup (the
ultimate purpose for having a switch statement), [...]
</pre>
</blockquote>
<pre wrap=""><!---->
Um, is this dogma? Wouldn't a switch statement also be a welcome
addition to the readability? I haven't had the time to follow this
thread (still catching up on my Google 50%) but I'm not sure I agree
with the idea that a switch should only exist for speedup.
</pre>
</blockquote>
<br>
A switch-statement offers only a modest readability improvement over
if-elif chains. If a proposal introduces a switch-statement but
doesn't support fast dispatch, then it loses much of its appeal.
Historically, the switch-statement discussions centered around fast
dispatch without function call overhead or loss of direct read/write to
local variables (see sre_compile.py and sre_parse.py for code would
would see a speed benefit but almost no improvement in readability).<br>
<br>
<br>
Raymond<br>
<br>
<br>
</body>
</html>