What does positional PICK on an object do in Rebol 2, and what's the equivalent Rebol 3? -


in rebol 2:

>> foo: make object! [a: 10 b: 20]  >> foo/a == 10  >> foo/b == 20  >> first foo == [self b]  >> second foo == [make object! [         a: 10         b: 20     ] 10 20]  >> third foo == [a: 10 b: 20]  >> fourth foo ** script error: fourth expected series argument of type:    series date port tuple event ** near: fourth foo 

so can pick out of if block values 1, 2, 3. doing positional selection right out in rebol 3:

>> first foo ** script error: cannot use pick on object! value ** where: first ** near: first foo 

i gather deprecated (like picking out of function parameter list). however, i'm trying translate code says like:

bar: construct/with (third foo) mumble 

(a) point of code?

(b) how translate rebol 3?

a) construct builds object without evaluating spec block. implies spec of some [set-word! any-type!] form (which if using body of object). construct/with uses second object (mumble) prototype.

b) object operations appear have changed follows:

i) first object replaced words-of object

ii) second object replaced values-of object

iii) third object replaced body-of object or to block! object

therefore code can replaced with:

bar: construct/with body-of foo mumble 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -