[Python-Dev] Re: anonymous blocks
ark-mlist at att.net
Mon Apr 25 17:00:16 CEST 2005
> Mixing both suggestions:
> from <target> as <value>:
> That resembles an import statement which some
> may consider good (syntax/keyword reuse) or
> very bad (confusion?, value focus).
I have just noticed that this whole notion is fairly similar to the "local"
statement in ML, the syntax for which looks like this:
local <declarations> in <declarations> end
The idea is that the first declarations, whatever they are, are processed
without putting their names into the surrounding scope, then the second
declarations are processed *with* putting their names into the surrounding
fun add(x:int, y:int) = x+y
fun succ(x) = add(x, 1)
This defines succ in the surrounding scope, but not add.
So in Python terms, I think this would be
local: <suite> in: <suite>
or, for example:
local: <target> = value
More information about the Python-Dev