Previous Section Next Section Table of Contents Glossary Index

Chapter 15. Platform-specific notes

15.4. Building an Application Bundle

You may have noticed that (require "COCOA") takes a long time to load. It is possible to avoid this by saving a Lisp heap image which has everything already loaded. There is an example file which allows you to do this, "ccl/examples/cocoa-application.lisp", by producing a double-clickable application which runs your program. First, load your own program. Then, do:


When it finishes, you should be able to double-click the Clozure CL icon in the ccl directory, to quickly start your program.

The OS may have already decided that Clozure isn't a valid executable bundle, and therefore won't let you double-click it. If this happens to you, to force it to reconsider, just update the last-modified time of the bundle. In Terminal:

> touch Clozure

When an image which had contained ObjC classes (which are also CLOS classes) is re-launched, those classes are "revived": all preexisting classes have their addresses updated destructively, so that existing subclass/superclass/metaclass relationships are maintained. It's not possible (and may never be) to preserve foreign instances across SAVE-APPLICATION. (It may be the case that NSArchiver and NSCoder and related classes offer some approximation of that.)

Previous Section Next Section Table of Contents Glossary Index