Why we will use obj$func() often
mark at prothon.org
Thu Apr 29 07:41:49 CEST 2004
Greg Ewing wrote:
> Mark Hahn wrote:
>> It turns out that Greg and I were mistaken. The &var syntax can
>> easily handle unlimited nested scopes and not even slow up my
>> one-pass compiler.
> It does incur the expense of a run-time lookup for
> intermediate-scoped variables, however.
Prototype-based systems incur a prototype chain lookup expense on every
single attribute lookup. This is a disadvantage compared to class-based
systems. See the Lieberman paper linked near the top of the Prothon home
That same paper also discusses a cache method that effectively eliminates
that expense. That same expense and cache fix will apply without change to
the closure lookup.
So the bottom line is there will effectively be no expense. We won't be
working on performance in Prothon until July or August though, so you'll
have to take my word on that until then.
More information about the Python-list