[CM] Packages again (was: more about CLM/CMUCL problem)

Torsten Anders t.anders@qub.ac.uk
27 Nov 2002 16:53:48 +0000

Dear Dave,

Sorry, I can not help you with your actual question.

Just a note on Lisp packages again. Your init file looks like you expect
the 'in-package' form to load anything. But the only purpose of Lisp
packages is to avoid name clashes, e.g. for functions with the same
name. You may include all symbols, functions etc. of some lisp program
in an own package. The 'in-package' macro then swaps the namespace for
all symbols etc. you use without package labeling. Actually it is the
same concept as packages in Java which you may know (but Java packages
can be nested).

* (in-package :cl-user)

* (between 10 20)	; cm function is not recognized
Warning: This function is undefined:
* (cm::between 10 20)	; OK with package marking
* (in-package :cm)

* (between 10 20)	; OK when you are in the CM package

In other word: your current init file as preobably no effect at all.
Obviously the programs CM, CLM and CMN are already loaded -- otherwise
you would get an error switching into their packages ;-)

There is no build-in high-level facility in Lisp to collect, e.g., all
your files of a Lisp program in a module, which can be loaded as a
single unit. But there are several Lisp extensions to do this, most
often they are called defsystem.

Kind regards,

PS: More information on packages can be found in the Common Lisp

On Wed, 2002-11-27 at 15:58, Dave Phillips wrote:
>   cmlisp.init includes these statements:
> 	(in-package :clm)
> 	(in-package :cmn)
> 	(in-package :cm)
Torsten Anders
Sonic Arts Research Centre
Queens University Belfast
Tel: +44 28 9027 4831