"load" with guards etc. ??



On Fri, Dec 21, 2007 at 10:50:45AM -0500, Kostas Oikonomou wrote:
> Here is an example of how to load the "distrib" package only 
> once, by testing if
> the provided function "random_continuous_uniform" is already 
> known:
> 
> /* The probability distributions package: */
> if not member(random_continuous_uniform, map(op,functions)) 
> then
>   load(distrib);
> 
> And a similar example with the bigfloat gamma function:
> 
> /* Gamma function/factorial with bfloats: */
> if not member(bffac, map(op,functions)) then
>   load(bffac);
>

thanks! In my case I have decided to write a new load-function,
which knows about the library etc. Then I don't think that
I need to go to the level of single functions, but I just
say "load file (if needed)" or "load file (in any case)",
where the first case is the default, and used in the library-files
(while the second case is needed if I need to reload a changed
library file into a running session).
That new load-function keeps a database of loaded files.

Oliver
 
> Oliver Kullmann wrote:
> >Hello,
> >
> >for our own library of Maxima-functions, which are distributed over
> >several .mac-files, we use "load" to include the files on which the
> >given file depends, right?
> >
> >So "load" is the equivalent of "#include" in the C/C++ world.
> >However, apparently there is no functionality concerned with
> >preventing multiple inclusions (especially circular inclusions)?
> >
> >I wonder how other users deal with that problem --- everybody writes
> >his little utilities to handle this, I guess? Or are some underlying
> >clisp-mechanisms used?
> >
> >Thanks for your help in any case.
> >
> >Oliver
> >_______________________________________________
> >Maxima mailing list
> >Maxima at math.utexas.edu
> >http://www.math.utexas.edu/mailman/listinfo/maxima