How to add ql dependencies into an asd

65 views
Skip to first unread message

Jeff Shrager

unread,
Aug 29, 2017, 12:37:40 AM8/29/17
to Quicklisp
Okay, I'm sure that I'm going to get flamed for asking such a simple question, but can you tell me how to put ql dependencies in my asd. For example, here's my example asd:

(in-package :asdf)

(defsystem foo

  :components

  ((:file "package")

   (:module "sub1"

            :components

            ((:file "package")

             (:file "sub1" :depends-on ("package"))

             (:file "sub1sub" :depends-on ("package"))))

   (:module "sub2"

            :components

            ((:file "package")

             (:file "sub2" :depends-on ("package"))

             (:file "sub2sub" :depends-on ("package")))

            )

   (:file "foo" :depends-on ("package"))

   ))


Now, suppose that the whole thing depends on cl-json, or something. Where to I put that? In the asd? In an eval-when in foo.lisp? ... (Honestly, in 40 years of using lisp to write ... probably a million lines of code and huge systems, I've only NOW bothered to learn how to use ASDF. I've always just rolled my own compilation meta-machinery. ... go ahead and laugh! :-)

Alexandre Rademaker

unread,
Aug 29, 2017, 5:22:33 AM8/29/17
to quic...@googlegroups.com
For example:

https://github.com/own-pt/cl-conllu/blob/master/cl-conllu.asd

Note the use of :depends-on 

Alexandre 
Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Quicklisp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quicklisp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Shrager

unread,
Aug 29, 2017, 6:55:49 AM8/29/17
to Quicklisp
Yow! So it magically knows that those are ql packages?! Seems to work (but seems magical!) I was trying all sorts of method pretzel logic. Thanks!

Alexandre Rademaker

unread,
Aug 29, 2017, 7:11:53 AM8/29/17
to quic...@googlegroups.com
This is precisely the most important benefit of Quicklisp, his ability to solve dependencies.

If a package you depend on is not yet in ql , but it is asdf installable, you can download it to the local-systems folder under ql directory to load it with ql or make other local packages depend on it too.

Alexandre
Sent from my iPhone

je...@cancercommons.org

unread,
Aug 29, 2017, 7:30:54 AM8/29/17
to Quicklisp
Yes, well, hard to argue with success; Thanks!

Anton Vodonosov

unread,
Sep 6, 2017, 7:06:09 PM9/6/17
to quic...@googlegroups.com
And that's not magic.
 
1. When you do (ql:quickload :foo), quicklisp first consults its index and downloads all the foo's dependencies it knows about (if any), and then loads foo via asdf.
 
2. (what seemed magic to you) : if asdf signals missing-dependency, quicklisp downloads that system too and retries: https://github.com/quicklisp/quicklisp-client/blob/master/quicklisp/setup.lisp#L181
 
 
 
 
29.08.2017, 14:11, "Alexandre Rademaker" <arade...@gmail.com>:
--

je...@cancercommons.org

unread,
Sep 6, 2017, 7:27:59 PM9/6/17
to Quicklisp
Yes, okay, small "m" magic - obviously there's an algorithm; I was just a bit taken-aback that it knew that these were ql packages when I hadn't even downloaded them. The thing I wasn't aware of was (among many other things) that QL and ASDF know about one another.

Anton Vodonosov

unread,
Sep 8, 2017, 7:48:58 AM9/8/17
to quic...@googlegroups.com
In one direction only - QL knows about ASDF; ASDF doesn't know about QL.
 

Zach Beane

unread,
Sep 8, 2017, 9:42:03 AM9/8/17
to quicklisp
But I think it's important to note that ASDF has key hooks, like asdf:*system-definition-search-functions*, that make it possible for Quicklisp to do what it does without too much extra work. Those hooks are extremely helpful.

Zach

To unsubscribe from this group and stop receiving emails from it, send an email to quicklisp+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Quicklisp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quicklisp+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages