Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Context - code included- 2nd version

From: lmecir:mbox:vol:cz at: 11-Sep-2001 3:30

> > > do (all but block) > > > > I don't think the last one is correct... > > Sure?
Probably you should explain what you meant by "do (all but block)", I am not sure I understood you.
> > to > > make > > Merci! > > > I am trying to comply with the official documentation if possible: > > > > special: first to block! "a" > > set special 1 > > ** Script Error: a is not defined in this context > > ** Where: halt-view > > ** Near: set special 1 > > > > This is how I can interpret it: > > > > 1) the word 'a stored in 'special is "in a context" > > 2) it is "in a context" where it "isn't defined" > > 3) I call that context the Special Context > > My interpretation: > in the actual context (global+locals) the word is not binded (defined). > > Es.
Aha, so you are trying to define a notion of Actual Context to help you to explain this situation. The problem with your explanation is, that the situation in your description looks like being caused by the fact the Word is not "defined" in the Actual Context. Even though I don't know your definition of the Actual Context, I am pretty sure, that it should be an extensible collection of Rebol Words, if it contains the Global Context, which is an extensible collection of Rebol Words itself. It provokes a thought that after an extension of the Actual Context the situation of the Word may change because after such an extension the amount of the "defined" Words must increase. But, alas, the opposite is true: no extension of anything can cause the Word to become "defined", because it will always remain the Special Word being a Special Word once. (Special Words are immutable Rebol values according to my findings!) That is why I prefer my explanation. ...
> I don't want to stress you about this very little question but I can't
resist Absolutely no problem. A nice discussion.
> You say: > > "I define a function, that can find out, if two given Words are bound to
> same Context: " > > now: in the function same-context?: > ... > special? word1 > special? word2 > ... > > which use the error: > > Script Error: wordx is not defined in this context. > > Which says that the word1 and word2 are not y > > defined(word1)<>y and defined(word2)<>y -> context(word1)=context(word2) > > is a logical error for me, but perhaps I'm in error. > > In effect: > > bind 'something SpecialWord > Script Error: SpecialWord is not defined in this context > > Why a word must be defined to bind something to it? Because defined binded > to a context. > If the last command could create a Special Word I should admit to be
wrong. Well, I can show you how: new-bind: func [ {bind a Word to a Context} word [word!] known-word [word!] ] [ if error? try [return bind word known-word] [ either loaded? word [ first find first rebol/words word ] [ first to block! mold word ] ] ]
> We could call Special Context the Fail or Error Context. :-)
The Fail Context or some such look well enough, maybe better than the Special Context...