Re: reason for having separate package.lisp?
- From: budden <budden-lisp@xxxxxxx>
- Date: Fri, 27 Feb 2009 13:02:15 -0800 (PST)
I have seen a good deal of simple, single file lisp code that does just whatyou're suggesting. Ironically, asdf.lisp itself uses precisely this
idiom!
Oops... I should have recall it before. It looks like all this thread
is redundant...
Sorry for that...
If you do so, you'll probably want to use #: to prevent the packageYes, I do that since I have first seen it somewhere. But no reason to
we're in when the file is read from being polluted with interned
symbols from the reading of your file, thus:
(defpackage #:foo (:use :common-lisp) (:export #:bar))I use defpackage :foo instead as I use keywords to find a package
definition.
I just type :foo at SLIME prompt and press M-. Also, it is useful to
do
(find-package :foo). Thus, it is likely that :foo will be created soon
anyway.
Nor am I am not aware of any implementation that has a bug that wouldOk, thanks.
cause you a problem using this idiom.
1. In general, you shouldn't write code to possible bugs, but to theI've seen some ingenious code which was written to the bugs. It is
standard.
screamer and ap5.
2. Still might not be the best idea to put the package form(s) in theIt depends on the situation. Some files are useful even when they are
same file 'cause it might make life more difficult for you down the
road.
not a part
of any system, e.g. net.hexapodia.toposort. And I see no reason why it
should ever
grow. I think if such a file depends on CL only, it is reasonable to
keep it single.
Adding a package file implies creation of .asd file too. So, we get
three files
instead of one without any serious reason. Then we would need a folder
for them, symlink
to asd file, and I think it is a great redundancy. On the other hand,
if we use clbuild,
asdf-install, or want to make asd systems depend on the file, we would
likely need asd
system too. But if I had resources, I'd better subclass asdf::system
to support such
single files. As there is other annoying problem: I still know no way
in SLIME to
type :foo, press magic key and visit foo.asd.
In addition, if you're using asdf as your original questionMmm, maybe this is one other good reason to make asd system for every
suggests you are, why not avail yourself of its ability to load
separate files in a well defined way?
file.
.
- References:
- reason for having separate package.lisp?
- From: budden
- Re: reason for having separate package.lisp?
- From: Tim Bradshaw
- Re: reason for having separate package.lisp?
- From: Zach Beane
- Re: reason for having separate package.lisp?
- From: budden
- Re: reason for having separate package.lisp?
- From: Raffael Cavallaro
- Re: reason for having separate package.lisp?
- From: budden
- Re: reason for having separate package.lisp?
- From: Raffael Cavallaro
- reason for having separate package.lisp?
- Prev by Date: Re: Optimize a function for speed
- Next by Date: Re: reason for having separate package.lisp?
- Previous by thread: Re: reason for having separate package.lisp?
- Next by thread: Re: reason for having separate package.lisp?
- Index(es):
Relevant Pages
|