[REBOL] [Fwd: Accessing a variable's method]
From: varnoux:atmel at: 10-Oct-2003 17:46
A few anti-slashes have been added (dunno know why...) :
Hi List,
I have a list of objects:
l: copy []
obj: make object! [ a: none calc: does [self/a: (self/a + 1)]]
append l make obj [a: 1]
append l make obj [a: 2]
I would like to write a function like:
inc-obj: func [arg][
arg/calc
]
That would allow me to do:
foreach o l [
inc-obj o
]
And output:
probe (first l)/a
2
probe (second l)/a
3
Is it possible ?
Best regards,
Vincent