Contexts was: Special word
[1/2] from: lmecir::mbox::vol::cz at: 8-Sep-2001 3:17
Hi, Rebols!
Summary: Romano discovered an interesting "feature": the System/words object
isn't the Global Context! Contexts.html
http://www.sweb.cz/LMecir/contexts.html ) needs a revision!
Romano:
> Now i want "stress" you with another question, about your "Special Word"
> concept.
<<quoted lines omitted: 7>>
> find first system/words first to-block "foo"
> ==none
Amazing! You revealed, that there are words that cannot be found in (first
system/words). That invalidates some parts of Contexts.html:
1) The first one is the statement, that the System/words object is the
Global Context. If I define the Global Context as the collection of all
Global words, than I get:
global?: func [
{find out, if the given Word is a Global Word}
word [word!]
] [
same? word bind word 'system
]
gw: bind first to-block "foo" 'system
global? gw ; == true
find first system/words gw ; == none
It is immediately obvious, that the System/words object is only a part of
the Global Context!
2) The second victim is the Visualize-context function as you pointed out,
because it can find only the words from System/words.
>Another case:
o: context to-block "foo2: 3"
find first system/words first to-block "foo2" ; == none
find first o first to-block "foo2" ; == [foo2]
> Now: "foo2" is in the context "o" but not in the Global context.
Not exactly, you can find the corresponding Global word as above, but not in
the System/words object!
> Romano
Excellent work Romano!
Ladislav
[2/2] from: lmecir:mbox:vol:cz at: 8-Sep-2001 15:07
Hi all,
Correcting myself:
I was wrong when I stated:
> The System/words object isn't the Global Context!
It really seems that the problem was caused by my definition of the Global?
function. I will try to rewrite the now obsolete parts of the %contexts.html
at my site soon.
Regards
Ladislav
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted