Having compiled the program, the next step is to attempt delivery, where you will load the compiled file in a fresh LispWorks session.
Programs are delivered with the function
deliver
. This function takes three mandatory arguments. There are also many optional keyword arguments to help Delivery make the smallest image possible.
You can read more about this function in Delivering your Application. Keywords to the Delivery Function, describes all the optional keywords available.
In this example, we do not use any of them, but just provide the mandatory arguments. They are:
This is the first function called when the application is run.
This is an integer in the range 0 to 5. It controls how much work is done to make the image smaller during delivery. At level 0, little effort is put into making a smaller image, while at level 5 a variety of strategies are employed.
deliver.lisp
) that loads the program and then calls
deliver
:(load-all-patches)
(load (sys:example-file "delivery/hello/hello"))
#+:cocoa
(compile-file-if-needed
(sys:example-file
"configuration/macos-application-bundle")
:load t)
(deliver 'hello-world
#+:cocoa
(write-macos-application-bundle
"/Applications/LispWorks 5.0/Hello.app"
;; Do not copy Lisp Source File
;; association from LispWorks.app
:document-types nil)
#-:cocoa "hello"
5
:interface :capi)
(quit)
lispworks-5-0-0-x86-win32.exe -init deliver.lisp
On UNIX or Linux, type the following into a shell:
unix% lispworks-5-0-0-x86-linux -init deliver.lisp
Note: the image name varies between the supported UNIX and Linux platforms.
On Mac OS X, use Terminal.app. Ensure you're in the directory of the image first:
unix% cd /Applications/LispWorks 5.0/LispWorks.app/Contents/MacOS
unix% lispworks-5-0-0-darwin -init deliver.lisp
If you want to see the output, you can redirect the output with
>
to a file or use
|
, if it works on your system.
hello.exe
on Windows,
hello
on UNIX/Linux, and
Hello.app
on Mac OS X.