Re: Naive DEFSYSTEM replacement

"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
I don't use the LW defsystem any more since I needed to write ASDF defsystems for things which purport to be portable anyway, so I can't speak for it.

> And ASDF vomited some bollocks about "UIOP" or something.

Are you using some home-grown installation of ASDF?  I just use the one which ships with LW which is current enough.

I hate ASDF but writing ASDF defsystems is pretty straightforward unless you have some strange requirements.

As an example here's a defsystem form for a system called "foo" (which in fact is a cut down version of the defsystem for my hax system of miscellaneous things (https://github.com/tfeb/tfeb-lisp-hax).  The files in this are mostly in chronological order of writing them: I just add new ones at the end, with appropriate dependencies for them where needed.  The very first, oldest, file mentioned has recently grown a dependency on a much more recent one.

(defsystem "foo"
  ;; metadata like author, home page elided
  ;; ...
  ;; this system depends on another whole system (QL will know how to
  ;; deal with this)
  :depends-on (#-LispWorks "closer-mop")
  :components
  ;; And here are the files
  ((:file "collecting"
    :depends-on ("utilities"))
   (:file "wrapping-standard")
   (:file "iterate")
   ;; More files some with dependencies
   ;; ...
   (:file "utilities")
   (:file "simple-loops"
    :depends-on ("collecting" "iterate" "utilities"))
   (:file "spam"
    :depends-on ("simple-loops"))
   (:file "metatronic"
    :depends-on ("utilities"))
   (:file "slog"
    :depends-on ("simple-loops" "collecting" "spam"
                 "metatronic"))
   (:file "let-values"
    :depends-on ("spam" "collecting" "iterate"
                 "utilities" "process-declarations"))
   (:file "process-declarations"
    :depends-on ("utilities"))
   ;; more
   ;; ...
   ))

For many purposes it works to just tell ASDF that the system is seria (viar :serial t) and then name the files in the sane order.  For instance my destructuring-match sysdcl looks like, in outline,

(defsystem "org.tfeb.dsm"
  :depends-on (...)
  :serial t
  :components
  ((:file "pkg")
   (:file "low")
   (:file "pll")
   (:file "cpll")
   (:file "dsm")
   (:file "extensions")))

And the dependencies are what you think they will be.

Of course, for almost all purposes any kind of system declaration tool is just the wrong approach which CL somehow got infected with at birth and has never recovered from.  I only use them really because I'm writing things I want other people to be able to use reasonably easily.  For my own purposes my source files just say

(needs ...)
(provides ...)

And this does what is required: there's no central notion of a system at all.

So:

> (needs (:org.tfeb.hax.collecting :compile t :use t :verbose t))
Looking for module :org.tfeb.hax.collecting
Probing ...
...
Probing QL:LOCAL-PROJECTS;ORG;TFEB;HAX;COLLECTING.LISP
 as     /Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/collecting.lisp
Found /Users/Shared/Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/collecting.64yfasl
Wrapper after-require-module
Wrapper org.tfeb.tools.require-module::forget-lw-systems
Loading :org.tfeb.hax.collecting from /Users/Shared/Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/collecting.64yfasl
...
Looking for module :org.tfeb.hax.utilities
Probing ...
Probing QL:LOCAL-PROJECTS;ORG;TFEB;HAX;UTILITIES.LISP
 as     /Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/utilities.lisp
Found /Users/Shared/Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/utilities.64yfasl
Wrapper after-require-module
Wrapper org.tfeb.tools.require-module::forget-lw-systems
Loading :org.tfeb.hax.utilities from /Users/Shared/Local/packages/lisp/lib/quicklisp/local-projects/org/tfeb/hax/utilities.64yfasl
...
Using package :org.tfeb.hax.collecting
((:org.tfeb.hax.collecting t))

require-module needs some care and attention as it's very old code: I will get around to it one day perhaps.

--tim

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.