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

[REBOL] Re: Function Context Query

From: robbo1mark:aol at: 4-Dec-2001 4:21

Joel Neeely/ everybody, perhaps you misunderstood my previous post, my concern was that uninitialised local words are treated differently between contexts and function-contexts. Please see below,
>> use [my-word] [print unset? get/any 'my-word]
true
>> my-func: has [my-word] [print unset? get/any 'my-word] >> my-func
false
>> my-func: has [my-word] [print none? get/any 'my-word] >> my-func
true
>>
In a use context they are initialised to the unset! value if they are not set BUT in a function context they are initialised to the none! value and that's what bothers me. I don't see a reason or logic for the distinction, can anybody please explain why these contexts are treated differently, as from what I can see it is possible to use uninitialised words in function contexts, well they're not actually uninitialised as REBOL sets them to 'none during function context creation, but WHY? What makes function contexts a special case? cheers, Mark Dickson