(2) Add a way to say Make this function I'm calling use *my* locals
and globals. This seems to meet all the agreed-upon-as-good use
cases, but there is disagreement over how to sensibly write it. The
calling function is the place that could get surprised, but people
who want thunks seem to
On 4/26/05, Jim Jewett [EMAIL PROTECTED] wrote:
I'm not sure I understand this. The preferred way would be
to just stick the keyword before the call. Using 'collapse', it
would look like:
def foo(b):
c=a
def bar():
a=a1
collapse foo(b1)
print b,
[Jim Jewett]
(2) Add a way to say Make this function I'm calling use *my* locals
and globals. This seems to meet all the agreed-upon-as-good use
cases, but there is disagreement over how to sensibly write it. The
calling function is the place that could get surprised, but people
who
[Paul Moore]
*YUK* I spent a long time staring at this and wondering where did b come
from?
You'd have to come up with a very compelling use case to get me to like this.
I couldn't have said it better.
I said it longer though. :-)
--
--Guido van Rossum (home page:
I don't think this proposal has any chance as long as
it's dynamically scoped.
It mightn't be so bad if it were lexically scoped,
i.e. a special way of defining a function so that
it shares the lexically enclosing scope. This
would be implementable, since the compiler has
all the necessary