On Mon, 2004-10-18 at 07:55, Sam Ruby wrote:
> I've been trying to make sense of Python's scoping in the context of 
> Parrot, and posted a few thoughts on my weblog:
> 
> http://www.intertwingly.net/blog/2004/10/18/Python-Parrot-and-Lexical-Scopes

It seems like everything on that page boils down to: all functions are
module-scoped closures.

Your example:

        Consider the following scope1.py:
        
         from scope2 import *
         print f(), foo
         foo = 1
         print f(), foo
        
        and scope2.py:
        
         foo = 2
         def f(): return foo
        
        The expected output is:
        
         2 2
         2 1

Is also useful for context, but I don't think you need the Perl
translation to explain it.

-- 
â 781-324-3772
â [EMAIL PROTECTED]
â http://www.ajs.com/~ajs

Reply via email to