This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Package initialisation in CL boot


On 07/03/2012 02:38 PM, Charles Turner wrote:
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.

That doesn't seem right. The *reader* interns the symbol, depending the current package and package prefixes. The defun just sets the symbol-function of that symbol.

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?

exporting a symbol that is not already interned in the package would be pretty rare. (It might be interned in an inherited package.) -- --Per Bothner per@bothner.com http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]