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

[REBOL] Re: another gotcha

From: lmecir:mbox:vol:cz at: 2-Dec-2001 18:12

Hi Patrick, to understand what is going on, you can either look at the MAKE OBJECT! description in http://www.sweb.cz/LMecir/contexts.html) or just realize how the SPEC argument is used by the MAKE native to create objects: The SPEC block (but not its subblocks!) is searched through and all Set-words are collected. That list is used to create a new object from. That is why if you don't include the ZONE: Set-word to the SPEC block, you will not have it included to the created object as a local word. <<Patrick>> (...) As I perceive it (in my case perceive is more appropriate than understand) the page's zone needs a holder (the "zone: none") in the object. I have tried to make an explicit holder instead and it works too : Rebol [] o-win: make object! [ explicit-holder: none page: layout [ banner "Gotcha !" zone: banner "rebol" do [explicit-holder: get 'zone] ] ] o-win/explicit-holder/text: "foo" show o-win/explicit-holder view center-face o-win/page Has anyone a good explanation for this ? (...) <</Patrick>> The success depends on what you want to achieve. I would call this a disaster, because you didn't make 'zone local at the cost of more complicated code. Cheers Ladislav