Right now, I'm in the middle of reading On Lisp, which is a good book, but quite a bit dryer than ACL. The lack of exercises and practice problems really affects the exposition of the material. I'm also practicing writing some Cocoa programs in Lisp using Clozure's Cocoa bridge. Here, I've encountered a simple problem, which I can't seem to work around.
To get the Cocoa bridge working, when I start up Clozure, I first have to type
Code: Select all
(require :nib)
I then load and compile the source file helloworld.lisp which loads a Cocoa NIB file called hello.nib that I created using Interface Builder
Code: Select all
(defpackage :hello-world
(:export main))
(in-package :hello-world)
(require :nib) ; Where does this go?
(defun main ()
(iu:load-nibfile (truename "ip:HelloWorld;hello.nib")))
Code: Select all
(hello-world:main)
If I leave out the (require :nib) altogether, then I get the error message:
Code: Select all
Read error between positions 83 and 124 in helloworld.lisp.
> Error: Reader error on #<BASIC-FILE-CHARACTER-INPUT-STREAM ("helloworld.lisp"/8 ISO-8859-1) #x302001546C3C>, near position 124, within " ()
> (iu:load-nibfi":
> Reference to unknown package "IU".
> While executing: CCL::SIGNAL-READER-ERROR, in process Listener(6).
> Type cmd-. to abort, cmd-\ for a list of available restarts.
> Type :? for other options.
1 >
How should I organize my source files in lisp? Do I need defsystem or asdf-install to load in package prerequisites, or can this be done without these tools?