title: Compiling Binaries with Clozure Common Lisp
body: <p>Given a simple program such as the following, how would you: </p>
  
  <ol>
  <li><p>compile it as a seperate image file to be loaded by the implementation, and what command line arguments would you use to load it? </p></li>
  <li><p>Compile it as a standalone binary that can be loaded and run as is.</p>
  
  <p><em>Note: I tried adding ":prepend-kernel t" when saving the application only to have the follow error thrown.</em></p>
  
  <pre><code>Error: value NIL is not of the
  expected type REAL. While executing: 
  CCL::&lt;-2, in process Initial(0).
  </code></pre></li>
  <li><p>How would you supress the welcome message?</p>
  
  <p><strong>The Program</strong></p>
  
  <pre><code>(defun main ()
    (format t "This is the program.")0)
  </code></pre></li>
  </ol>
  
  <p><strong>Edit</strong></p>
  
  <p>Hate to answer part of my own question, but I found it none the less.</p>
  
  <p>After the function has been loaded type the following to compile it:</p>
  
  <pre><code>(ccl:save-application "app")
  </code></pre>
  
  <p>This creates an image file. To load it by passing it to the implementation type (note: the 'ccl' binary is in my system path);</p>
  
  <pre><code>ccl -I app
  </code></pre>
  
  <p>To run a top level function pass it as a parameter</p>
  
  <pre><code>ccl -I app --eval (main)
  </code></pre>