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