[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? does not try to see if "foo" in the path is a defined word.
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
What does it mean? None doen't exist in the context or exists a word called
We can check it with Type? which return none! or word! in the two situation.
> [probe value? probe in user 'noname]
Noname has not value, IN return "noname", which has no value, so false is ok.
> [probe value? probe in user 'lastname]
Lastname does not exist in user, IN return None, None has a value (itself), so
Value return true and is OK.