Re: First multi-file/package prog with lispworks personal edition on windows





Kent M Pitman wrote:
Ken Tilton <ken@xxxxxxxxxxxxxxxxxx> writes:


In the first file you load, have:

(defpackage #:my-first-package
(:nicknames #:pkg1)
(:use #:common-lisp)
(:export #:my-first-function))


I recommend breaking the above form off into a separate file. Anyone
who uses this package might want to be able to load the package
definition, even people not planning to call the functions.

Kind of an edge concern, don't you think? Should we scare noobs with those? And I do not program that way.. maybe if one of the six people using Cells asked for that, otherwise....


For example,
someone wanting to process the symbols in the other files. Or someone
planning to define different definitions for the same package (not that
I particularly recommend that).

The informal convention on the Lisp Machines was that every "system"
(approximately, what CL calls a "compilation unit" and what the OP
here thinks of as a set of files) had a pkgdcl.lisp that was just that
package declaration.

Having done this, you can then do
(mapcar #'load '("pkgdcl.lisp" "my-defs.lisp" "my-callers.lisp"))
but you can also break things up differently.

Add a remove-if there is a fasl with a more recent date and you have ASDF beat.



(in-package :pkg1)

(defun my-first-function yada yada

In the second file:

(in-package :pkg1)

(defun my-first-caller ()
(my-first-function))

If you want the second file to be a diff package, do a defpackage
there


or in a separate file, again,


of my-second-package, have it :use the first pkg, then have the
in-package form for the second package and you can reference the first
function.

To load multiple file projects semi-painfully use mk::defsystem or ASDF.


semi-painfully? As upposed to fully painfully? Hmmm.


Fully painfully is clipping in OpenGL. Semi-painful is ASDF.

I assumed the noob was also interested in project management given the multi-file thing, and I guessed wildly they were not lucky enough to be using the AllegroCL Project Manager, so I wanted to recommend the most automated things available, but I also wanted to make clear that ASDF, well, is not all that user-friendly. It's only recommendation is ubiquity, and, once conquered, will however awkwardly provide push-button builds.

kxo


--
http://www.theoryyalgebra.com/

"Algebra is the metaphysics of arithmetic." - John Ray

"As long as algebra is taught in school,
there will be prayer in school." - Cokie Roberts

"Stand firm in your refusal to remain conscious during algebra."
- Fran Lebowitz

"I'm an algebra liar. I figure two good lies make a positive."
- Tim Allen

.



Relevant Pages

  • Re: First multi-file/package prog with lispworks personal edition on windows
    ... I recommend breaking the [package declaration] off into a separate ... Jeez, Kent, give me some credit. ... Indeed, instead of load, a better function should be used that does all ... "Algebra is the metaphysics of arithmetic." ...
    (comp.lang.lisp)
  • Re: ubuntu burn-in for new computer?
    ... and I installed Breezy and Dapper-flt5 on it with virtually no ... Is there a package that does this, ... compile everything in sight? ... I would recommend a couple of things. ...
    (Ubuntu)
  • Re: Website/FTP Management
    ... > Can anyone recommend a good package for maintaining a remote website ... I looked at the 'mirror' package, ...
    (Fedora)
  • Re: Partition Encryption
    ... Check your package manager for a package ... Older cryptsetup versions need to be patched to include LUKS ... after suspend to disk" a feature. ... I recommend removing the paragraph ...
    (comp.os.linux.security)
  • doc/reality over-shoulder kits
    ... I need to recommend an audio bag package for a doc/reality equipment ... recommended for the secondary recorder? ... how do you handle a second camera? ...
    (rec.arts.movies.production.sound)