Package initialisation in CL boot

Charles Turner chturne@gmail.com
Tue Jul 3 21:39:00 GMT 2012


I can't tell from reading the spec what DEFUN is supposed to do with
the symbol passed to it in terms of packages. It follows from common
sense that it should intern the symbol, as the typical use case is to
export some defined symbols, and by interning the symbol, you
guarentee that it will be at least accessible. So I've overriden
Lisp2#defun in CommonLisp to intern the symbols in the current
package, as I didn't want ELisp dumping it's forms in CL packages.
I've done a similar thing with defStdBlahBlah methods too.

I've found it quite tricky to figure out exactly how other ANSI CL's
do this. The general theme appears to be to export all standard
symbols at boot time, and define them later. This matches how you use
DEFPACKAGE. For the other standard library symbols, it seems to be the
case that the implementation interns the symbols in a "system" package
(SBCL uses "SB!IMPL", ABCL uses one called "SYSTEM"), and then export
the library functions from Lisp using (export 'something) at
definition time. What I'm a little confused about is whether all the
standard symbols need to be interned *as well as* being exported. It
shouldn't make any difference in finding the symbols, but am I missing
something else?

Thanks,
Charlie.



More information about the Kawa mailing list