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

[REBOL] Re: Building scripts

From: zokie:libero:it at: 19-Jan-2002 15:07

Hello Brett On 16-Gen-02, Brett Handley wrote:
> Sometimes I think it would be nice to have all functions contained within > a single script, but obviously maintenance would be a pain. Rugby's build
To spread my scripts as stand-alone script I had thought: 1) make a self-installing script 2) join manualy all used scripts in to one. 3) make a rebol-script to do the dirty job for me Becouse my scope is to realize as soon as possible the third of above options, I had designed all my script to be easily included. After Reabol's header are present command like: do %path/to/script01.r do %path/to/script02.r .... do %path/to/script0n.r All included scripts are only declaration & definition of functions. Functions will be used by code into the main script, which contain specific functions and special function called as the script, which embeddes all the main-code, and the last code line of the script launch main-function with arguments if needed. Doing so it is easy to do cut'n'paste with a text-editor, but will be even simple to make a script which collect all external script used by current script and the make all substitution, using recursion it is possible resolve deep inclution like script05.r includes script03., which includes... We could split in 2 phases all the job. The first joins all scripts, the second strips all unused functions from the stand-alone script.
> via direct inclusion. One advantage over my current re-use technique would > be that the scripts would only instantiate what was required to make them > run rather than, as is now, potentially creating functions, etc that are > never evaluated.
I had begin to collect all my funtion, grouping them in to specific libraries, so I have a directory called zTools which is contains these re-usable scripts. Now there are few script ready, but more will come: string-Tools.r internet-Tools.r block-Tools.r I include them (do %/rebol/zTools/....) every time I need a function yet developed & debugged :) now all this is only an idea, but if you like we can develope it. Regards -- "Where did you get all those facts!?!"