Faheem Mitha | 11 May 2012 07:51

Loading external packages in Common Lisp with SLIME on Debian


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")))

(Continue reading)

Faheem Mitha | 11 May 2012 08:22

Re: Loading external packages in Common Lisp with SLIME on Debian


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)
(Continue reading)

Don Geddis | 11 May 2012 19:49
Favicon

Re: Loading external packages in Common Lisp with SLIME on Debian

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 <at> faheem.info> 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,
(Continue reading)

Nikodemus Siivola | 12 May 2012 08:56
Gravatar

Re: Loading external packages in Common Lisp with SLIME on Debian

On 11 May 2012 09:22, Faheem Mitha <faheem <at> faheem.info> wrote:

> 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

Normally, LOAD executes code, and COMPILE-FILE only compiles it.
EVAL-WHEN can be used to force evaluation to happen at compile-time.

REQUIRE is one way to load dependencies. ASDF:OOS 'ASDF-LOAD:OP is
another way to say ASDF:LOAD-SYSTEM, which in turn is another way to
load dependencies.

http://gigamonkeys.com/book/ is a good book to read.

Cheers,

 -- nikodemus

------------------------------------------------------------------------------
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/
Faheem Mitha | 12 May 2012 21:04

Re: Loading external packages in Common Lisp with SLIME on Debian


On Sat, 12 May 2012, Nikodemus Siivola wrote:

> On 11 May 2012 09:22, Faheem Mitha <faheem <at> faheem.info> wrote:
>
>> 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
>
> Normally, LOAD executes code, and COMPILE-FILE only compiles it.
> EVAL-WHEN can be used to force evaluation to happen at compile-time.
>
> REQUIRE is one way to load dependencies. ASDF:OOS 'ASDF-LOAD:OP is
> another way to say ASDF:LOAD-SYSTEM, which in turn is another way to
> load dependencies.
>
> http://gigamonkeys.com/book/ is a good book to read.

Hi Nikodemus,

Thanks for the reply. Yes, I found a section on EVAL-WHEN in PCL. Also, 
Rainer Joswig provided a helpful response to my SO question. So, I now 
have an idea what is going on.

                                                        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 
(Continue reading)


Gmane