Thanks, Martin answered it quite well...
In addition, this is the way the majority of languages handle it.
If a variable is not defined locally, then it is by default global.
It was Lisp in 1959 that first adopted this rule. They are called
"free variables".
Of course, we did not do it in REBOL for that reason alone.
We did it to make life a lot easier for beginners. Experts already
know what to do.
-Carl
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Andrew Martin
> Sent: Tuesday, April 24, 2001 4:59 PM
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Re: Q: Functions and the visibility of words
>
>
> Jussi Hagman wrote:
> > When a word is definied inside a function it is visible also outside the
> function (after the invication of the function) unless explicitly
> specified
> local. This seems to be a different approach to most of the other
> programming languages (at least that I know :).
>
> > The disadvantages are obvious, it is easy for the programmer to
> introduce
> unwanted side-effects, but what are the advantages this scheme introduces?
>
> I believe that some of the advantages are:
> * Speed -- don't have to allocate local words on demand.
> * Ease of use for newcomers to rebol scripting -- words aren't hidden
> inside functions.
> * Also, Rebol doesn't seem to have a way of referring to a parent or
> containing context. This approach reduces the need for this.
>
> There's probably some other reasons as well -- I don't know them.
>
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.