[REBOL] REBOL's scoping rules Re:(3)

2000-07-20 Thread bhandley
> With respect to > > > So now, I don't tend to think of global variables as just that. > Instead I > > know I can create symbols in a global context, and I can also set > symbols in > > a specific context. And I can write Rebol descriptions that will work > on > > both depending on context! > > c

[REBOL] REBOL's scoping rules Re:(5)

2000-07-20 Thread lmecir
Hi Rebols, Brian wrote: > Here's some REBOL pseudo-code of this (for block! spec): > make-object: func [spec [block!] /local c o] [ > c: copy [self] > foreach x spec [ > all [ > set-word? x > none? find c (x: to-word x) > insert tail c x

[REBOL] REBOL's scoping rules Re:(4)

2000-07-19 Thread brian . hawley
Hi all! [EMAIL PROTECTED] wrote: >Hello [EMAIL PROTECTED], > >On 19-Jul-00, [EMAIL PROTECTED] wrote: > > > [EMAIL PROTECTED] wrote: > > > >> In REBOL you don't only have two scopes (contexts) - you have a tree > of contexts, each one with a parent context, the top level context being > what you

[REBOL] REBOL's scoping rules Re:

2000-07-19 Thread brian . hawley
Hi Keith! [EMAIL PROTECTED] wrote: >I've been wondering what the reasoning behind REBOL's scoping >rules was for awhile. In C, for instance, any variable that >you declare in a function is "automatic" (that's what C calls >them anyway :). They're automatically local to the function >they're defi

[REBOL] REBOL's scoping rules Re:(2)

2000-07-19 Thread mjmalpha
gt; Sent: Tuesday, July 18, 2000 10:58 PM Subject: [REBOL] REBOL's scoping rules Re: > Judging by previous message on the list, this question will bring a variety > of responses! > > Re "global variables". > Coming from a compiled-language background, it was hard for me

[REBOL] REBOL's scoping rules Re:

2000-07-19 Thread bhandley
Judging by previous message on the list, this question will bring a variety of responses! Re "global variables". Coming from a compiled-language background, it was hard for me to learn about the immediate nature of the message I send to Rebol. More important, I had to get out of my old ideas of t

[REBOL] REBOL's scoping rules Re:(2)

2000-07-19 Thread giesse
[EMAIL PROTECTED] wrote: > In REBOL you don't only have two scopes (contexts) - you have a tree of contexts, >each one with a parent context, the top level context being what you could call >global variables. This is probably not true; each context is independent from the others. > As you can

[REBOL] REBOL's scoping rules Re:(2)

2000-07-19 Thread lmecir
Hi, > > I've been wondering what the reasoning behind REBOL's scoping rules was for > > awhile. In C, for instance, any variable that you declare in a function is > > "automatic" (that's what C calls them anyway :). They're automatically local > > to the function they're defined in, etc. (...) >

[REBOL] REBOL's scoping rules Re:

2000-07-19 Thread giesse
[EMAIL PROTECTED] wrote: > Why does REBOL have variables be globally scoped by default? I ran into this Because REBOL does not have something like a "scope". Notice that there are no variables at all, only values. Some of these values, called "words", have the ability to refer to other values.