[REBOL] Re: local vars in functions
From: holger:rebol at: 25-Apr-2002 11:20
On Thu, Apr 25, 2002 at 10:17:38AM +0200, Ladislav Mecir wrote:
> </Holger>
>
> Although that sounds logical, it is not the whole truth. Compare the way how
> USE declares the local variables (the declarations don't appear in the BODY
> argument) vs. the way how CONTEXT declares the local variables (the
> declararions appear in the BLK argument). That surely isn't a non-option.
Yes, it is the whole truth. Read again:
: Scanning the function
: body is not an option, because declarations could be "hidden", e.g. with
: something like [do rejoin ["a" ": " "1"]], i.e. there is no way for "func"
: to
: know about all declarations without actually executing the function.
The only reason why 'context allows implicit declarations is because it
executes its body. Functions obviously cannot do that at declaration time.
--
Holger Kruse
[kruse--nordicglobal--com]