Re: Why we will use obj$func() often
From: Mark Hahn (mark_at_prothon.org)
Date: Wed, 28 Apr 2004 22:41:49 -0700
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.