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

[REBOL] Re: Special word was: help from Dixon or others about port

From: rotenca::telvia::it at: 7-Sep-2001 18:27

Thank you for port info. Now i want "stress" you with another question, about your "Special Word" concept. I make a word:
>> word? first to-block "foo"
== true The function Special return true for: Special? first to-block "foo" == true foo is not in system/words: find first system/words first to-block "foo" ==none and your Visualize-Context return: either special? word [ first system/words ] But "foo" is not in the context... I think this is a Very Very Special Word (note the 2 Very), because it is not in a true (hidden/not hidden) context. Another case:
>> o: context to-block "foo2: 3" >> find first system/words first to-block "foo2"
== none
>> find first system/words/o first to-block "foo2"
== [foo2] Now: "foo2" is in the context "o" but not in the Global context. So when we call visualize-context: v-c bind first to-block "foo2" in o 'self == [self] it doesn't see "foo2" because visualize-context scans system/words to find words: foreach s-word first system/words [ if not same? s-word b-word: bind s-word word [ append result b-word ] ] I think this is a Very Special Word (note the only one Very), because it is not in the Global Context but is in a object! context. The same thing can happen per Local words which exist like Local but not like unset Global: x: to-block "foo3" use x compose/deep [find first system/words first [(:x)]] ==none or z: func x compose/deep [y: [(:x)] print get first y find first system/words first y]
>> z 6
6 == none Visualize-Context fails with these Locals for the same reason. Rebol gives different errors for these different Special Words: 1) Script Error: foox is not defined in this context -> Very Special and Very Very Special 2) Script Error: fooy has no value -> (Only) Special For me the (Only) Special Words are only unset Global Word. --- Ciao (my english is bad) Romano