[REBOL] Re: Q: Functions and the visibility of words
From: al:bri:xtra at: 25-Apr-2001 11:59
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/