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

[REBOL] Re: Evaluating words...

From: lmecir:mbox:vol:cz at: 25-Sep-2001 22:07

Hi,
> > Could you please elucidate the following taken from a textbook > > "In the case of values that have a scalar datatype like decimal!, > > the evaluation results in the value itself. > > In more complex situations, a word may reference an instruction
sequence.
> > The value of the word is that sequence of instructions.During > > the value's evaluation, each instruction is evaluated. > > The evaluatiuon concludes with the last instruction in the > > expression sequence.Then the result of executing the last > > instruction in the expression sequence is returned as the value > > of that word." > > > > Urk! I hope that's not in my book<g>. > > --Ralph Roberts > author, REBOL FOR DUMMIES
Oops! I don't want to explain the sentence you cite. (Romano would have to say that for me everything is either confusing, misleading, unclear or wrong!) I offer you a replacement instead: 1) A word can refer to a value. 2) If a word (meant as a value of the WORD! datatype) is evaluated, the type of the value it refers to is checked. If the value the word refers to has one of the following types: ANY-FUNCTION!, LIT-WORD!, SET-WORD!, LIT-PATH!, PATH!, SET-PATH!, then the value is further processed by the interpreter in accordance with its actual type. E.g. for ANY-FUNCTION! the interpreter collects argument values and evaluates the function supplying it the collected arguments. Only if the value referred to by the word does not have one of the above mentioned datatypes, it is not processed any further and it immediately becomes the result of the evaluation. Ladislav