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

[REBOL] R: Re: what about this one?

From: rotenca:telvia:it at: 7-Jul-2001 0:42

> > ->> user: context [name: "Petr"] > > ->> value? 'name > > == false > > ->> value? 'user/name > > == true > > ->> value? 'user/lastname > > == true
Every path, taken as a lit-word, give true:
>>value? 'foo/bar
==true Value? does not try to see if "foo" in the path is a defined word.
>>value? 'foo
==false Now Value? try to see if "foo" is a defined word (it isn't). A bug or a undocumented feature about path? Paths, i know, are not word and are interpreted in a different way. Many functions can't reduce a path to the target word and needs the use of IN. But IN return None if the word doesn't exist in the object context. So the return of IN is not the best for Value? because None has a value (itself). A limit case is this:
>> k: context [none: 'none] >> in k 'none
== none What does it mean? None doen't exist in the context or exists a word called None? We can check it with Type? which return none! or word! in the two situation.
> [probe value? probe in user 'noname] > noname > false
Noname has not value, IN return "noname", which has no value, so false is ok.
> [probe value? probe in user 'lastname] > none > true
Lastname does not exist in user, IN return None, None has a value (itself), so Value return true and is OK. ciao romano