what's in a name (was Re: using lambda to print everything in a list)
Greg Ewing
see at my.signature
Tue May 1 01:56:58 EDT 2001
Joshua Marshall wrote:
>
> let:
> x = lenthy_function()
> y = even_larger_function()
> pi = math.pi
> e = math.e
> in:
> res = e**(pi*x+y)
>
> But (unfortunately) Python doesn't have variable declarations and will
> probably stay that way.
That's not a fatal problem. The above could be interpreted
as introducing a local name scope such that (1) assignments
occurring in the "let:" section create new bindings in this
scope, (2) these bindings are available for use in the
"in:" section, but (3) assignments in the "in:" section
bind names in the outer scope.
Rather convoluted semantics, though!
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list