Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Bind and Use

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/