Your example fails because 'a/q2 is a path! not a word!
Your example:
a: make object! [ q1: 100]
value? 'a/q2
>> ; failed example
>> a: make object! [ q1: 100]
>> value? 'a/q2
== true
>> ; first, comprehend value?
>> source value?
value?: native [
"Returns TRUE if the word has been set."
value
]
; your example fails because value? returns true on the word 'a,
not the path 'a/q2
>> ; REBOL truth
>> word? 'a/q2
== false
>> path? 'a/q2
== true
you write:
" My problem is the words I need to check if they are assigned,
they are contained in an object."
To overcome your obstacle you must learn the design of REBOL,
the virtual computer (see, you can look at life correctly as
obstacles -- freedom thinking, or incorrectly as problems --
officialdom indoctrination thinking) .
The definitional of any object is just a block. Think of the
outer [] as "invisible".
>> probe a
make object! [
q1: 100
]
>> first a
== [self q1]
>> type? first a
== block!
>> second a
== [make object! [
q1: 100
] 100]
>> type? second a
== block!
Let's use 'a as a prototype for 'b
>> b: make a [
[ q2: "some aspect"
[ ]
>> probe b
make object! [
q1: 100
q2: "another aspect"
]
Let's define debate (my word for func) to discover the aspects
of any object
aspects: debate [
internals [object!]
][
probe next first internals
]
>> aspects: debate [
[ internals [object!]
[ ][
[ probe next first internals
[ ]
>> aspects b
[q1 q2]
== [q1 q2]
>> type? aspects b
[q1 q2]
== block!
now, we can 'find on the aspects of any object
>> find aspects a 'q1
[q1]
== [q1]
>> find aspects a 'q2
[q1]
== none
>> find aspects b 'q2
[q1 q2]
== [q2]
You could parse if you had expectation of an existing layout of
object words (internals), e.g.,
If you expect your object to look like
b: context [
q1: 100
q2: "some aspect"
]
then you can use parse, e.g.,
>> internals: ['q1 'q2]
== ['q1 'q2]
>> parse aspects b internals
[q1 q2]
== true
>> new-internals: ['q1 'q2 'q3]
== ['q1 'q2 'q3]
>> parse aspects b new-internals
[q1 q2]
== false
Here are two great works that can help you comprehend what's
going on inside REBOL:
http://www.fm.vslib.cz/~ladislav/rebol/contexts.html
http://www.pat665.free.fr/doc/bind.html
Also, you can check out my work, which is alternative way of
looking at REBOL (non-computer science, non-High Priests of
Academia way) at http://rebolese.blogspot.com
Pier Johnson
Thousand Oaks, CA, USA
________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.