I'm not an expert in packages, and use them only when it seems
there is no other way...
But when I use them it is in order to shadow names. If you want to
over-ride or shadow an operation, say $integrate from :maxima,
you could do
(defpackage :my (:shadowing-import-from :maxima $integrate)
and do computations in the :my package.
see, e.g. http://www.cs.berkeley.edu/~fateman/generic for lisp package
setup for generic arithmetic, overloaded +, *, etc.
This works, but may not be the best use.
RJF
----- Original Message -----
From: "Raymond Toy" <raymond.toy at ericsson.com>
To: "Barton Willis" <willisb at unk.edu>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Tuesday, January 31, 2006 7:30 AM
Subject: Re: [Maxima] advice on using packages
>>>>>> "Barton" == Barton Willis <willisb at unk.edu> writes:
>
> Barton> -----Raymond Toy wrote: -----
> Barton> (Q1) Is all this :import stuff really
> >> needed?
> >>
> >> I think it would work without the :import-from,
> >> since you're :use'ing :maxima already. That is,
> >> no package qualifiers needed to refer to a
> >> symbol in the maxima package.
>
> Barton> In GCL, it doesn't seem to work that way:
>
> MAXIMA> (defpackage :my (:use :common-lisp :maxima))
> Barton> #<"MY" package>
> MAXIMA> (in-package :my)
> Barton> #<"MY" package>
> MY> (add 5 6);
>
> Oops. That's because ADD is not an external symbol of the maxima
> package. In fact, I'm pretty sure maxima doesn't export ANY symbols,
> so my suggestion here doesn't really work the way you want.
>
> But it does suggest that you really want to be in the maxima package
> when doing your stuff with your MY package. :-)
>
> >> I think you would typically be in the maxima
> >> package and access stuff
> >> from your MY package. Of course, you'd have to
> >> use package qualifiers
> >> (my::foo) to access them, unless you tell maxima
> >> to :use your package.
>
> Barton> Oh--I understand. Thanks.
>
> One other thing. The MY package should decide what to export as it's
> public interface to maxima. Then you can use either my:foo or just
> foo if maxima :uses your package.
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>