[REBOL] Re: object method binding
From: g:santilli:tiscalinet:it at: 9-Nov-2001 11:31
Media wrote:
> weird: make object! [
> weird-func: func [][
> print external-variable
> ]
> ]
I don't know if I understand correctly, but maybe this can help:
>> use [external] [
[ external: "I am the one"
[ f: func [a] [print [a "-" external]]
[ ]
>> f 3
3 - I am the one
>> external
** Script Error: external has no value
** Near: external
Now if we want to create a function G that works like F...
>> external-word: third second second :f
== external
>> get external-word
== "I am the one"
>> g: func [a] compose/deep [print [a "-" (external-word)]]
>> g 3
3 - I am the one
>> source g
g: func [a][print [a "-" external]]
HTH,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/