Go to the first, previous, next, last section, table of contents.


Understanding Used Packages

It has been said that software is truly successful when it begins to be used for things that the implementors never expected.

One kind of Muq package is the library: A package of canned functionality intended to be used by other Muq packages.

It is possible to take advantage of libraries simply by accessing their exported functions via colon syntax as lib-x:fn-a, lib-y:fn-b and so forth, but such use of package-name prefixes can be wearisome if the library functions are frequently used.

An alternative is to do

"lib-y" usePackage

This permanently enters package lib-y into @$s.package$s.usedPackages, making all exported symbols in lib-y available inside the current package just as though they were internal.

This does mean, of course, that the current package must not have any symbols with the same name as an exported symbol in lib-y, nor may lib-y have any exported symbol with the same name as any other exported symbol in any other package already used by the current package.

The unusePackage function may be used to undo the effect of an usePackage: See section `unusePackage' in Muf Reference.


Go to the first, previous, next, last section, table of contents.