If I understand the problem correctly....
I think you need to traverse the inner objects first, only then returning the
value at the top level (if any).
clanobj: make object! [clan: none Name: "Ahem"]
Me: make object! [
Name: "Sabu" Surname: "Francis"
Family: make clanobj [clan: "Vadukkut"]
]
getValInObject: func [object Member /local val v res][
foreach word next first object [
val: get in object word
if object? val [
res: getValInObject val Member
if not none? res [return res]
]
]
return get in object Member
]
print getValInObject Me 'clan
print getValInObject Me 'Name
My code fails to distinguish between
none -- the value of 'Name was "none"
and
unset -- there was no Name field
Both return None (in recent versions of REBOL). I'll leave you to fix that --
assuming this solution is on the right track.
Sunanda.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.