[REBOL] Re: [bind] Patrick's pages ; using 'local ; using bind/copy
From: rotenca:telvia:it at: 15-May-2003 17:41
Hi, Marc
> On the other hand,
> you point out a situation where there is a function without local words...
>
> But, in this case, what could be the good reason to bind a word or a block
> to an "unexisting" context...
> I was unsucessfull to find a realistic example where one would like to bind
> a block
> in such circumstances ... ???
The concept of local words in functions as a different thing from arguments
and refinements is only an appearance.
Strictly speaking, functions have arguments and refinements defined as local
words. They have not locals words which are not arguments or refinements.
Examples. Given:
x: [a]
a: 0
1) Classic situation, here 'a is defined like a local word (indeed it is the
argument of the /local refinement!)
do func [/local a][a: 34 print bind x 'a]; == 34
2) Here 'a is defined like an argument of the function (and it is also a local
word)
do func [a][a: 34 print bind x 'a] 1; == 34
3) Here 'a is defined like an argument of another refinement (and it is also a
local word)
do func [/new a][a: 34 print bind x 'a]; == 34
4) Here 'a is defined like a refinement! (and it is also a local word)
do func [/a][a: 34 print bind x 'a]; == 34
---
Ciao
Romano