Page 1 of 1

how use libraries without QL

Posted: Fri Aug 14, 2015 10:20 am
by anaumov
Hello,

does anybody know how use/include libraries (which was installed with Quicklisp), but without Quicklisp?
For example, I installed the library X with QL (ql:quickload "X"), after that I close my sbcl/clisp and start it again. In this moment the system still does not know about QL. How to include new library X in my project without QL?

Thank you,
Alex

Re: how use libraries without QL

Posted: Fri Aug 14, 2015 10:38 am
by Goheeca
You can load Quicklisp by yourself and then load the given library:

Code: Select all

;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "qkcl/setup.lisp"
                                       (user-homedir-pathname))))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)))
Looking to my gists on Github, I've used only asdf, that's another possibility:

Code: Select all

(require :asdf)
(require :some-library-installed-by-ql)

Re: how use libraries without QL

Posted: Sat Aug 15, 2015 12:24 pm
by pjstirling
REQUIRE is part of your implementation, and isn't required (lol) to know anything about asdf. Also the proper way to load asdf systems is ASDF:LOAD-SYSTEM

Re: how use libraries without QL

Posted: Sat Aug 15, 2015 2:10 pm
by Goheeca
Well, back in the day I was using:

Code: Select all

(asdf:oos 'asdf:load-op :system) ;or
(asdf:operate 'asdf:load-op :system)
because of this site (I'm going to fix that and add the load-system option).

When I was writing that gist I didn't like the tardiness of writing the aferomentioned asdf part and used require instead, provided that require is enhanced by asdf. I can't recall clearly why I used the first line with require (either that wouldn't work without it at specific circumstances in a specific implementation or I've just wanted that there for cleanliness) -- I know it's now lengthy as well.

So for the OP, for completeness I provide the code for loading:

Code: Select all

(asdf:load-system 'some-library-installed-by-ql) ;or
(asdf:load-system :some-library-installed-by-ql)