Next: , Previous: , Up: Making a small Lisp project with quickproject and Quicklisp   [Contents][Index]


5.10.1.5 Reuse

  1. With something like swatchblade, I would probably re-use it by

    a) starting Lisp, b) loading the project with ql:quickload, and c) running a function to start Hunchentoot with the swatchbade handler in effect.

  2. The final package definition might look something like this:
(defpackage #:swatchblade
  (:use #:cl)
  (:export #:start-web-server)
  (:shadowing-import-from #:vecto
                          #:with-canvas
                          #:rounded-rectangle
                          #:set-rgb-fill
                          #:save-png-stream))
  1. The session then might look something like this:
* (ql:quickload "swatchblade")
loading output
* (swatchblade:start-web-server :port 8080)
Server started on port 8080.
  1. With a project that is meant to be used more as a library, the package would likely have many more exports, and I would re-use it by passing it with the ‘:depends-on’ argument of quickproject:make-project, e.g.:
    (quickproject:make-project "~/src/lisp/whimsytron/" 
                               :depends-on '(swatchblade))
    
  2. From there I can go back to the "Write some code" step and continue the cycle.