12.1.1 Writing a delivery script

The next task is to create a delivery script. This is a Lisp file that, when loaded into the image, loads your compiled application code into the image, then calls the delivery function deliver to produce a standalone image.

The first delivery should be at delivery level 0. A successful delivery at this level proves that the code is suitable for delivery as a standalone application. After assuring yourself of this, you can look into removing code from the image to make it smaller.

If the delivered image is small enough for your purposes, there is no need to pursue a smaller image. An application delivered at level 0 contains a lot more in the way of debugging information and aids, and so is in some ways preferable to a leaner image.

The startup function in the Othello game is cl-user::play-othello . The initial delivery script therefore looks like this:

(in-package "CL-USER")
;; Load the compiled file othello. Should be in the same 
;; directory as this script.
(load (current-pathname "othello" nil))
;; Now deliver the application itself to create the image othello
(deliver 'play-othello "othello" 0 :interface :capi)

Save this script in the newly created othello directory as script.lisp .

LispWorks Delivery User Guide - 14 Mar 2008