[REBOL] Re: Destroy no more useful functions
From: joel:neely:fedex at: 16-Apr-2002 16:42
Here's my preferred approach...
Didier Jacquemart wrote:
> I wrote a source file, containing several general purpose functions,
> called funcsrc.r
> In a program, i then write
> do %funcsrc.r
> .... calling funcs
> When my program ends, i want to destroy all the funcs included by
> funcsrc.r. But writing unset 'func1, unset 'func2 ... is a bit
> boring and much unsure.
> Has anybody an idea ?
Assuming that funcsrc.r contains a related collection of functions,
modify funcsrc.r so that it defines a single object having all of
those functions as members/methods.
make object! [
func1: func [...] [...]
func2: func [...] [...]
You can use this in the following manner:
fns: do %funcsrc.r
then, at the end of the useful life for the function library