[REBOL] Re: to-block bug?
From: brett:codeconscious at: 14-Aug-2002 10:31
Hi Ashley,
> Anyone care to explain why a fails and b works even though they are
> [apparently] identical?
Same words - different (or missing context).
> >> a: [btn green]
> == [btn green]
These words are part of global context. The processing of LOADing them gives
them this context by default. Same as using
LOAD "btn green"
> >> b: to-block "btn green"
> == [btn green]
To-block returns a block with words in it, but the words are not
automatically given a context.
> >> view layout a
> >> view layout b
> ** Script Error: green word has no context
> ** Where: do-facets
> ** Near: green
For the global context, the word GREEN is set to the value 0.255.0.
For a word to have a value, it can only be within a given context, and since
the word GREEN in b has no context it cannot have a value.
Sum up, the words in A have the same names as the words in B, but they are
different words. The words in A have a context set for them while those in B
do not have a context.
Regards,
Brett.