Search code examples
lispcommon-lispquicklispallegro-cl

Where should a Quicklisp QUICKLOAD go in my source? Nowhere?


Let's say I build an application on top of net.aserve and bordeaux-threads. My package declaration might look like this:

(defpackage :my-package
  (:use :cl :net.aserve :bordeaux-threads)
  (:export …))

I use Quicklisp, so I run (ql:quickload "aserve") (ql:quickload "bordeaux-threads") in SLIME before compiling my package, and everything is fine.

Of course, tomorrow I start up SLIME again and I have to remember to issue the QUICKLOADs before I compile, otherwise I'm in for trouble.

I could put something like

(eval-when (:compile-toplevel)
  (ql:quickload "aserve")
  (ql:quickload "bordeaux-threads"))

at the top of my package—it's what I've done for development—but I have a feeling it's not a good idea to force a package manager on a user.

Is there a better alternative?


Solution

  • In your asd file, you should define the depends realtion as below:''

    (asdf:defsystem #:aserve
     :serial t
     :depends-on (#:hunchentoot :hunchentoot-cgi
               #::bordeaux-threads
               #:parenscript)
     ...)
    

    After then you just need to (ql:quickload :aserve) .