[CSC 330] Using Multiple Source Files in Lisp

Andrew J. Pounds pounds_aj at mercer.edu
Tue Nov 5 07:00:21 EST 2024


I was asked the other day about how I broke apart my LISP code into 
separate source files.  I general it is recommended to use ASDF (Another 
System Definition Facility) which is really the standard for doing this 
in lisp -- but that is overkill here.  I don't have a separate exercise 
on ASDF set up on CANVAS, but I know some of you are interested in 
getting LISP done and just want to break up your code.  Here is how I 
did that without having to do all of the ASDF stuff...

I have one file (in this case called fivecardstud.lisp) that contains 
the following:

(load "card.lisp")
(load "util-functions.lisp")
(load "main-functions.lisp")
(load "hand-functions.lisp")
(load "tablescore.lisp")
(load "main.lisp")

To run my program I then type "sbcl --script fivecardstud.lisp"

You could, alternatively, include the #!/usr2/...    stuff at the top 
and make just fivecardstud.lisp executable to run it with just the name 
of the program.

-- 
*/Andrew J. Pounds, Ph.D./*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University, Macon, GA 31207 (478) 301-5627/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc330/attachments/20241105/4174a054/attachment.htm>


More information about the csc330 mailing list