This post in reply to the Post, why doesn't ospd3 work in M12, M13 and M14

Sometimes it is appealing to have a package export a procedure which does not show up when calling with().

For example, the procedure might be used elsewhere, but be otherwise so very technically obscure that nobody else would be interested. (The counter-argument is that what is good for the goose is good for the gander! If something else in Maple can make good use of it and need it, then you might too.)

Now, Maple's modules don't have the concept of "friends", ie. routines which are available to friendly modules but not otherwise public. So there is a use to having something be an export of a module but not get listed after issuing with() on that module's name.

> restart:

> m:=module() option package; export f,g,h,_pexports;
>   g := proc() "something used elsewhere"; end proc;
>   _pexports := proc()
>                 [op({exports(thismodule)} minus {:-g, :-_pexports})];
>                end proc;
> end module:

> with(m);

                                   [f, h]

> exports(m);

                             f, g, h, _pexports

> m:-g();

                         "something used elsewhere"

Notice that `g` can be called from outside of `m`. But `g` is not listed after issuing with(m).

Please Wait...