[REBOL] Re: Q: Functions and the visibility of words

2001-04-27 Thread Sanghabum
From: [EMAIL PROTECTED] (Ingo Hohmann) .. on default global variables [EMAIL PROTECTED] spoketh thus: The disadvantages are so major, that something needs to be done. And here are two things I've come up with ... snip From: [EMAIL PROTECTED] (Andrew Martin) 2. I've gotten into the habit of

[REBOL] Re: Q: Functions and the visibility of words

2001-04-26 Thread Sanghabum
[EMAIL PROTECTED]: 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 :).

[REBOL] Re: Q: Functions and the visibility of words

2001-04-26 Thread Andrew Martin
Colin wrote: 2. I've gotten into the habit of starting all functions like this: myfunc: func [ /local aa bb cc dd] Why not get Rebol do the work for you? Fun: function [ Automatic local word generation for a function. [catch] Spec [block!]{Optional help info followed by arg

[REBOL] Re: Q: Functions and the visibility of words

2001-04-26 Thread Ingo Hohmann
... on default global variables [EMAIL PROTECTED] spoketh thus: The disadvantages are so major, that something needs to be done. And here are two things I've come up with ... context: func [ Defines a unique (underived) object. *patched* (iho) blk [block!] Object variables and values.

[REBOL] Re: Q: Functions and the visibility of words

2001-04-26 Thread Volker Nitsch
Ursprüngliche Nachricht Am 26.04.01, 06:02:32, schrieb [EMAIL PROTECTED] zum Thema [REBOL] Re: Q: Functions and the visibility of words: [EMAIL PROTECTED]: When a word is definied inside a function it is visible also outside the function (after the invication of the function

[REBOL] Re: Q: Functions and the visibility of words

2001-04-25 Thread Renaud
You can use local words by asking for it (cf example at the bottom) with /local un the argument block or with a USE inside the body... so it's possible to avoid side effects. The way a language treat locality is just a choice. In PHP, variables are all locals to function... unless you ask them

[REBOL] Re: Q: Functions and the visibility of words

2001-04-25 Thread Carl Sassenrath
] 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

[REBOL] Re: Q: Functions and the visibility of words

2001-04-24 Thread Andrew Martin
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

[REBOL] Re: Q: Functions and the visibility of words

2001-04-24 Thread Ryan Cole
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,