Peter,

This is getting into libary design. I too have libraries, and an include
function (I have seen the one below and mine is similar - writing an include
function in REBOL is really pretty trivial). My approach is to group similar
functions together into one library file, that way I don't have a zillion
files and I don't have to define every function under the sun when all I
want is one or two.

What do you want to use the "functions in different files" for? Ie how will
you be using them? Programmatically, from other REBOL scripts, or
interactively from the console? Programmatically, the 'include thing is the
way to go. From the console, I have written a %shell.r which I 'do in my
%user.r. This effectively extends the REBOL vocabulary to make the REBOL
console a more effective shell: things like 'cd, 'pwd, 'dir, 'rgrep.

- Michael Jelinek

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 18, 2000 2:55 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] Calling external functions Re:


I can't take credit for this function, but I've used it to "include" several

different scripts and use their functions:

include: func [files] [
    either block? files [
        forall files [do first files]
    ] [
        do files
    ]
]

include %whatever.r

Many thanks to the author of this function! :-)

>From: [EMAIL PROTECTED]
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [REBOL] Calling external functions
>Date: Thu, 18 May 2000 15:38:05 +0200
>
>Hello!
>
>Currently I am working on a project that I would like
>to divide into several script files.
>
>I will then have one main script file from where I
>want to call functions in different files.
>
>How will I solve this? I have tried to 'load' the file
>but I can not evaluate a specific function within the
>file.
>
>Best regards,
>Peter Carlsson
>
>----------------------------------------------------------------
>Peter Carlsson                    Tel: +46 31 735 45 26
>Saab Ericsson Space AB            Fax: +46 31 735 40 00
>S-405 15 G�teborg                 Email: [EMAIL PROTECTED]
>SWEDEN                            URL: http://www.space.se
>----------------------------------------------------------------
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Reply via email to