Bind and Use
[1/3] from: al::bri::xtra::co::nz at: 5-Mar-2002 15:23
Patrick wrote:
> I would like to know more about bind and use.
'bind is used to make Rebol script written outside a context, appear to be
written inside a context. For example:
>> Test: [print [1 2 3]]
== [print [1 2 3]]
>> x: make object! [
[ print: func [x] [rebol/words/print ["Result:" x]]
[ f: does [do bind Test 'self]
[ ]
>> x/f
Result: 1 2 3
>> Test: [
[ print [4 5 6]
[ print [7 8 9]
[ ]
== [
print [4 5 6]
print [7 8 9]
]
>> x/f
Result: 4 5 6
Result: 7 8 9
>>
'use allows one to reuse words. For example:
>> use [print] [
[ print: func [x] [rebol/words/print ["Result:" x]]
[ print 1 + 2
[ ]
Result: 3
>>
>> print "test"
test
>>
I hope that helps!
Andrew Martin
Working for the Rebolution...
ICQ: 26227169 http://valley.150m.com/
[2/3] from: lmecir:mbox:vol:cz at: 5-Mar-2002 8:56
Hi all,
it looks like both me and e-scribe missed the original message from Pat. The
reliability of delivery seems questionable?
Cheers
L
From: "Andrew Martin"
Sent: Tuesday, March 05, 2002 3:23 AM
Subject: [REBOL] Bind and Use
Patrick wrote:
> I would like to know more about bind and use.
'bind is used to make Rebol script written outside a context, appear to be
written inside a context. For example:
>> Test: [print [1 2 3]]
== [print [1 2 3]]
>> x: make object! [
[ print: func [x] [rebol/words/print ["Result:" x]]
[ f: does [do bind Test 'self]
[ ]
>> x/f
Result: 1 2 3
>> Test: [
[ print [4 5 6]
[ print [7 8 9]
[ ]
== [
print [4 5 6]
print [7 8 9]
]
>> x/f
Result: 4 5 6
Result: 7 8 9
>>
'use allows one to reuse words. For example:
>> use [print] [
[ print: func [x] [rebol/words/print ["Result:" x]]
[ print 1 + 2
[ ]
Result: 3
>>
>> print "test"
test
>>
I hope that helps!
Andrew Martin
Working for the Rebolution...
ICQ: 26227169 http://valley.150m.com/
[3/3] from: rebol665:ifrance at: 5-Mar-2002 9:55
Hi Ladislav,
There is no problem of reliability here. Andrew simply changed the subject.
Previous subject was "Re diversion".
Patrick