Paul Rubin wrote:
> James Stroud <[EMAIL PROTECTED]> writes:
> 
>>Probably, with good code, block scope would be overkill, except that I
>>would welcome list comprehensions to have a new scope:
> 
> 
> Block scope is a win because it gets rid of the uncertainty of whether
> the variable is used outside the block or not.

    In a language with few declarations, it's probably best not to
have too many different nested scopes.  Python has a reasonable
compromise in this area.  Functions and classes have a scope, but
"if" and "for" do not.  That works adequately.

    Javascript got it wrong.  They have declarations, but the default,
in the absence of a declaration, is global, not local or an error.
Bad design.  It's a result of retrofitting declarations to a language,
which usually has painful aftereffects.

                                        John Nagle
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to