MLUG: Re: [MLUG] guess what
Re: [MLUG] guess what
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Thu, 1 Apr 2004, Michael wrote:

> >I noticed that typo as well.  But nobody has every made it clear to 
> >me why Python does not have true lexical scoping.  My best guess was 
> >that, lacking a non-white-space bracketing device, you just can't do
> >this:
> >  
> >
> What difference does braketing possibly make? Either way, internally, 
> the language works the same. You could, and I've seen it done, modify 
> Python to use braces and it changes absolutely nothing in the languages 
>  behavior.

Which means they are just being willful.  Feh.  And it still doesn't 
mean that Python's scoping rules are sensible.
 
> You can do that, to a limited degree, but why would you want to. It's 
> bad program design. You should use an object to define scope or just use 
> explicit variable passing to the function. Besides, Python has 
> generators specificlly for tasks like that.

The *point*, though, is that this is a demonstration of what true
lexical scoping would really look like and what it allows.  There is
a lot more out there than Python.  I don't have any more time to
talk about lexical closures and their uses.  Just google it,
Michael.

jking


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members