I'm new to the world of Lisp project structure and I tackled my first bigger project in Lisp. That's why I started with a project skeleton made by quickproject:make-project
. After this, my first idea was to create a folder structure, but I didin't knew exactly how I want to do it so I just made a few files to split code into.
I put some of my code in a file called pixel.lisp
, some in gameview.lisp
and the main loop is in pixelworld.lisp
.
My asd file looks like this:
;;;; pixelworld.asd
(asdf:defsystem #:pixelworld
:description "Describe pixelworld here"
:author "Your Name <[email protected]>"
:license "Specify license here"
:version "0.0.1"
:serial t
:depends-on (:sdl2 :cl-opengl)
:components ((:file "package")
(:file "pixel")
(:file "gameview")
(:file "pixelworld")))
If I understood it correctly this file should tell quickproject
how to compile my system when I ql:quickload
it. And because :serial
is t
it should compile in sequence. If I compile and evaluate each file by hand from top to bottom this works without any problem, so there is no problem with the dependencies. But when I ql:quickload
the project and go into the package with (in-package :pixelworld)
I cant run the main function because the other expressions in my system are not evaluated. Is there something fundamental I do not understand about this, or is there another command I have to use with quicklisp to get what I want? Thanks in advance. :)
Like Travis Sunderland and tfg mentioned in the comments, it is important to have (in-package :pixelworld) on top of every file. After the change it worked flawlessly.