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

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

From: holger:rebol at: 10-Sep-2001 20:11

On Tue, Sep 11, 2001 at 03:58:02AM +0200, Ladislav Mecir wrote:
> Hi Holger, > > > > 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 > > > > That is not necessary. Don't invent something if you don't have > > to :). Occam's Razor... > > You just misunderstood the error message. The "is not defined" refers > > to the word not existing (in this context), > > I am not able to accept the notion of This Context, as you present it, I am > sorry.
That error message is a "catch all" for situations in which REBOL encounters a word which is not bound into a context, when the operation REBOL attempts to perform requires the word to be bound. This includes 'get, 'set, evaluation of a word, evaluation of a path, 'protect, 'bind (the sample word) etc. Whether the word has a value does not even matter (unless the particular operation requires a value). This further illustrates that the issue is binding, not value, and that "is not defined" has nothing to do with values. Example:
>> set first to-block "a" 1
** Script Error: a is not defined in this context ** Near: set first to-block "a" 1
>> set 'a 1
== 1 Those are the facts. Whether you agree with the exact wording of the error message is your choice. "a is not bound into any context" would probably be more accurate, but also somewhat more technical and more difficult to understand for new users. Regardless of what the exact message text is, contexts work in a certain way, a "Special Context" the way you describe it does not exist in REBOL and is not necessary or useful to describe the existing behavior.
> The notion of This Context is totally contradictory to the behaviour > of Rebol I am observing.
I did not present any notion of "This Context" at all :), so how it can contradict any observed behavior, and what behavior is that ? -- Holger Kruse [holger--rebol--com]