Guido van Rossum wrote:
> Would this also use ..num to refer to num in an outer scope two levels 
> removed?

I realize this was a wink, but it is a valid problem with the 
"dot"-proposal.

def foo(n):
   def bar(n):
     def baz():
       return .n

So, which 'n' outer 'n' is being referenced? Seems like you need to 
either be able to do multiple dots (ugly, hard to read) or only do a 
single-step outwards reference. But then that has it's own problems, if 
I meant the 'n' passed into 'foo', then I have to resort to such 
nonsense as:

def foo(n):
   def bar(n):
     foon = .n
     def baz():
       return .foon

It would almost be cute if you could do something like ".foo.n" to get 
to the correct variable. If python maintains it's current scoping rules, 
then it seems like it works out, but I haven't thought this one all the 
way through.

def foo(n):
   def bar(n):
     def baz():
       return .foo.n + .bar.n

-- 
Scott Dial
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to