where is upvar

Garry Hodgson garry at sage.att.com
Wed Sep 20 14:15:08 EDT 2000


Harald Kirsch wrote:
> 
> Jon Ribbens <jon+python-list at unequivocal.co.uk> writes:
> > Accessing variables in other peoples' scopes directly is nasty anyway,
> > use function arguments ;-).
> 
> Not if it is documented and if the sole purpose of a certain function
> is to do that in a defined way. Those functions are sometimes called
> `control structures'. It seems like Tcl is a bit ahead of Python here,
> as it allows to create functions which look, smell and work like
> custom made control structures.

it's arguable whether this is a good thing or not.  i've used languages
which allowed this, including tcl.  it's cute, but of limited utility.
and the readability cost can be high.

-- 
Garry Hodgson                   Once in a while
Senior Hacker                   you can get shown the light
Software Innovation Services    in the strangest of places
AT&T Labs                       if you look at it right



More information about the Python-list mailing list