[REBOL] Re: Q: Functions and the visibility of words
From: ryanc:iesco-dms at: 24-Apr-2001 18:05
First think about this: Using rebol, I use far fewer temporary variables.
In fact I can write vast amounts of code without using them at all. So it
is not a big loss.
As far as unwanted side effects, this depends on the particular scheme you
use for accessing non-local words. For instance, assuming an unset word is
local could pose just as many problems too. Making all global words be
declared could be ugly, since these declarations would be everywhere. They
all seem to be double edged swords. In some languages such defualt to local
makes more sense, but because of my first point, I think Carl probably made
a good decision with defualt to global.
Jussi Hagman wrote:
> I have been playing with REBOL for a some time but I still am curious
> about the word visibility scheme chosen by Carl.
> 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
> Jussi Hagman CS in Åbo Akademi University
> Studentbyn 4 D 33 [juhagman--abo--fi]
> 20540 Åbo [jhagman--infa--abo--fi]
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
I am enough of an artist to draw freely upon my imagination.
Imagination is more important than knowledge. Knowledge is
limited. Imagination encircles the world.