Assembling systems out of many different subparts, is beyond the Common
Lisp standard. So there are a variety of possible approaches.
ASDF is certainly a start, but you may also want to investigate
Quicklisp:
http://www.quicklisp.org/beta/
You seem to be a novice in Lisp, and not quite understand read-time
vs. compile-time vs. load-time vs. other times. Quicklisp may be more
along the lines of "it just works" for you, which will help you get
productive and give you a chance to learn more later.
-- Don
Faheem Mitha <faheem@...> wrote on Fri, 11 May 2012:
> On Fri, 11 May 2012, Faheem Mitha wrote:
>
>>
>> Hi,
>>
>> I just posted the following on Stack Overflow.
>>
>> http://stackoverflow.com/questions/10543906/loading-external-packages-in-common-lisp-with-slime-on-debian
>>
>> Short short version: I want an easy way to load external package dependencies
>> into a lisp file I am writing. This is not as easy as one would like it to
>> be.
>>
>> After posting this, I found http://xach.livejournal.com/130040.html which
>> goes into the issue in a little more detail. To quote the article,
>>
>> "I need to make sure cl-ppcre is compiled loaded before my file is compiled
>> and loaded. The easiest way is to make a simple ASDF system file.'"
>>
>> So, it seems that one needs to have the external dependency loaded before one
>> can compile the file, which is in line with what my experiments showed. If
>> one attempts to add the external dependency as part of the file one is trying
>> to compile, the compilation fails.
>>
>> However, the article does not have a complete, self-contained example that I
>> can use. I tried
>>
>> (asdf:defsystem #:foo
>> :depends-on (#:split-sequence)
>> :components ((:file "foo")))
>>
>> (split-sequence:SPLIT-SEQUENCE #\, "foo,bar")
>>
>> (everything in one file) but that doesn't work either.
>>
>> I tried putting it in a separate asd file, but the system doesn't seem to
>> find it - I'm guessing it doesn't look in the current directory by default.
>> In any case, I don't want to have to create a separate file for every script
>> I create.
>
> Addendum. I found an answer, but don't know why it works. From my SO post:
>
> ##########################################################################
>
> I came across the following post, Zach Beane's Blog - Making a small
> Common Lisp project (http://xach.livejournal.com/130040.html), which had a
> link to http://common-lisp.net/~loliveira/ediware/ediware.lisp
>
> Copying the code at that top of that file works. So running C-c C-k in
> slime on this file loads split-sequence, and runs the code int
> (split-sequence:SPLIT-SEQUENCE #\, "foo,bar"))
>
> #+:sbcl
> (eval-when (:compile-toplevel :load-toplevel :execute)
> (require :asdf))
>
> (eval-when (:compile-toplevel :load-toplevel :execute)
> (asdf:oos 'asdf:load-op :split-sequence))
>
> (defpackage #:seq
> (:use #:cl #:split-sequence))
> (in-package #:seq)
>
> (print (split-sequence:SPLIT-SEQUENCE #\, "foo,bar"))
>
> However, I've no idea what these magical incantations do. Would anyone
> care to explain, perhaps in another answer? I'm putting this in an answer,
> because it is an answer to the question, but it is not complete, because I
> don't understand why it works. I'll gladly accept an explanation of this
> script.
>
> ###############################################################################
>
> I guess the first line is a reader macro, so I'll have to start with that.
>
> Regards, Faheem
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
|