[Python-3000] Switch and static, redux

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat Jul 15 20:38:34 CEST 2006


Greg Ewing <greg.ewing at canterbury.ac.nz> writes:

> So I'd like to propose that "def time" be modified
> slightly to mean "def time of the outermost function
> that is still inside the scopes containing all the
> names that the case expressions depend on". Not
> sure about the wording of that, but I hope you get the
> idea. In the above example, that would be the def time
> of f(), rather than g().

If it was possible to define constants (as opposed to variables),
including recognizing imported named constants, then the natural
semantics of switch (evaluate cases at the time of the switch)
would be easy to optimize.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Python-3000 mailing list