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

Importing scripts as functions?

 [1/7] from: mat:eurogamer at: 1-Dec-2000 14:29


Heya Folks, Awhile back I asked the question on how it might be possible to import other scripts so some sort of modulate system could be built up. I plan to build a multi-purpose IRC bot where folks can build their own functions as scripts. Andrew pointed me at his effort; AM> It would be very quick if you use modular plugins to load the scripts at AM> start up. Have a look at the %units.r script on my site: AM> http://members.nbci.com/AndrewMartin/Rebol/ Which is far too complicated for me to understand what he's really doing. However what I *did* realise is that you can build functions up using Rebol - making my assertion that somehow my bot would go off and execute the script files on demand quite silly. Can anyone explain in simple terms, how some Rebol could import another script and install it as a function or whatever? I've tried some basic experimentation by creating objects from read scripts but that doesn't seem to work. -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee http://www.eurogamer.net | http://www.eurogamer-network.com

 [2/7] from: arolls:bigpond:au at: 2-Dec-2000 2:24


> Can anyone explain in simple terms, how some Rebol could import > another script and install it as a function or whatever?
You don't mean just do'ing a file, eg. rebol[] do %my-library.r ; define some nice functions that I use all the time ... ; now use the functions here do you? Anton.

 [3/7] from: mat:eurogamer at: 1-Dec-2000 22:48


Heya Anton, A> rebol[] A> do %my-library.r ; define some nice functions that I use all the time A> ... A> ; now use the functions here A> do you? That was my initial thoughts, of course. My initial question was, how do you parse arguments to the new script. Since then, I've seen some nifty stuff to do with using Rebol build objects which are actually rebol code. I just don't know how to make it work. -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee http://www.eurogamer.net | http://www.eurogamer-network.com

 [4/7] from: gchiu:compkarori at: 2-Dec-2000 12:22


On Fri, 1 Dec 2000 22:48:48 +0000 Mat Bettinson <[mat--eurogamer--net]> wrote:
> That was my initial thoughts, of course. My initial > question was, how > do you parse arguments to the new script. >
You could always create your own dialect a la VID -- Graham Chiu

 [5/7] from: mat:eurogamer at: 2-Dec-2000 1:50


Heya Graham, GC> You could always create your own dialect a la VID I'm sure I could, if I knew how :) -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee http://www.eurogamer.net | http://www.eurogamer-network.com

 [6/7] from: arolls:bigpond:au at: 2-Dec-2000 14:11


> GC> You could always create your own dialect a la VID > > I'm sure I could, if I knew how :)
Check out Ingo Hohmann's TUI dialect. It makes a really good tutorial. I'm glad I found it. http://www.rebolforces.com/tui-dialect.html But you will need to know parse fairly well to fully understand. Go here to learn about parsing: http://www.rebol.com/users/parintro.html For those who don't know parse yet, it's hard but worthwhile. It took me a few weeks of breaking my head open, now it doesn't seem so hard. Anton.

 [7/7] from: mat::eurogamer::net at: 2-Dec-2000 4:05


Heya Anton,
>> I'm sure I could, if I knew how :)
A> Check out Ingo Hohmann's TUI dialect. A> It makes a really good tutorial. I'm glad I found it. A> http://www.rebolforces.com/tui-dialect.html Interesting stuff, well worth a look. I'm not sure it's the solution to my problem though. I'd like to let other folks write commands for my IRC bot in Rebol - rather than a custom dialect. -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee http://www.eurogamer.net | http://www.eurogamer-network.com