Search code examples
lispcommon-lispclisphunchentoot

Where are the files for a package?


Following this clisp basic website tutorial it asks me to define a package to persist the code:

(defpackage :retro-games
   (:use :cl :cl-who :hunchentoot :parenscript))

However, I cannot work out where my code is being persisted. Where are the files?

NB: I have only one day's experience with lisp!


Solution

  • Where are the files? They are where you want them.

    1. Create a new file anywhere you want.
    2. Put the definitions into the file.
    3. Done

    Lisp can LOAD files and you can use COMPILE-FILE.

    In Common Lisp there no connections between files, the location of a file and a package. The package definition just defines a namespace to symbols. But this is not necessarily connected to a file. Some tools help maintain something called a system, which is a collection of files, which can be compiled and loaded together.

    To get a basic understanding how to use Common Lisp I recommend reading Practical Common Lisp by Peter Seibel.