I'm new to CL and am using AllegroCL. I'm trying to figure out how to organize my source code to meet the following requirements:
I've been trying to creatively use ASDF to meet these requirements, and I can't get it right. How do other people approach this problem? Are these 2 requirements just not "Lispy"?
Use ASDF or use the Allegro CL defsystem tool.
I am using quicklisp which makes a "quicklisp"-folder in your home-folder in which a "local-project" folder can be found. This one contains a txt file in which you can insert the URIs to the .asd files.
How to use that utility:
project.asd (manages the includes for the pure project code)
(asdf:defsystem :project-name
:description "description here"
:version "version here"
:author "your name here"
:depends-on (:a
:list
:of
:dependencie
:libraries)
:components ((:file "sourcefileone")
(:file "sourcefiletwo")))
project-test.asd (manages the includes for the test code)
(asdf:defsystem :project-name-test
:description "testing"
...
:depends-on (:project-name)
:components ((:file "sourcefileone-test")
(:file "sourcefiletwo-test")))
now insert the URIs for those files into the above named local-projects.txt
program parallel the project source in < filename>.lisp files and the test-calls in < filename>-test.lisp files (the *-test.lisp files have to contain a test-execute call)
start your sbcl or whatever you use and then use (ql:quickload "project-name")
or (ql:quickload "project-name-test")
depending if you just want to load a project or test it.
The only thing you have to do porting this anywhere else, is to write the local-projects.txt on the computer the project is copied on. After that your colleges may depend on it using asdf-files and quickload in any other project they want. For copying the project folder you can either use ctr+c/v or maybe something more sophisticated as git.
For testing I programmed my own small test-suite, but I bet there are good ones out there. More information about quicklisp can be found here and about asdf here. Maybe this question can help you if you get stuck configuring quicklisp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With