PromoteToGlobal()?
Tony Balinski
ajbj at free.fr
Mon Mar 10 01:01:25 CET 2008
Quoting Thorsten Haude <yoo at vranx.de>:
> Hi,
>
> * Bert Wesarg wrote (2008-02-07 20:52):
> >On Feb 7, 2008 8:32 PM, Bert Wesarg <bert.wesarg at googlemail.com> wrote:
> >> can someone please explain why this is necessary?
> >OK, I think this has to do with some sort of forward declaration. If a
> >function is used before it was defined, the symbol is promoted to
> >global. Right?
>
> Anyone? If the question came up it must mean that documentation is
> missing, so it would be nice if we could add it.
My understanding is to allow left-to-right scanning of expressions in the
parser.
In
a = fn(b)
when fn is encountered, it's treated as a local. When ( is seen, fn is
promoted to global, since all functions are global.
At least, that's my understanding until I check parse.y!
Tony
More information about the Develop
mailing list