Talin wrote:

> I don't have any specific syntax proposals, but I notice that the suite 
> that follows the switch statement is not a normal suite, but a 
> restricted one, and I am wondering if we could come up with a syntax 
> that avoids having a special suite.

don't have K&R handy, but I'm pretty sure they put switch and case at 
the same level (just like if/else), thus eliminating the need for silly 
special suites.

> The only real difference between this and an if-else chain is that the 
> compiler knows that all of the test expressions are constants and can be 
> hashed at compile time.

the compiler can of course figure that out also for if/elif/else state- 
ments, by inspecting the AST.  the only advantage for switch/case is 
user syntax...

</F>

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to