A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-February/032736.html below:

[Python-Dev] Extended Function syntax

[Python-Dev] Extended Function syntax [Python-Dev] Extended Function syntaxSamuele Pedroni pedronis@bluewin.ch
Sun, 2 Feb 2003 17:25:43 +0100
From: "Guido van Rossum" <guido@python.org>
> > > What are the scope rules for blocks passed into method calls in
> > > Smalltalk?
> >
> > they are not ambiguous in the sense we are referring here:
> >
> > def f():
> >   x=3
> >   foo:
> >     x=4 # new x or old x?
>
> OK, so what are the rules in Smalltalk?  Could we use the same rules
> in Python?

in (modern) Smalltalk blocks introduce a new scope and are closures with
rebinding ability. Nothing to copy from there.

In Python inline-suites do not introduce a new-scope, functions introduce a new
scope and closure but without rebinding, 'class' introduces a new-scope. I
really think that the cases should be syntactically separated.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4