how use libraries without QL

Discussion of Common Lisp
Post Reply
anaumov
Posts: 10
Joined: Thu Sep 15, 2011 4:13 am
Location: Germany
Contact:

how use libraries without QL

Post by anaumov » Fri Aug 14, 2015 10:20 am

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

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: how use libraries without QL

Post by Goheeca » Fri Aug 14, 2015 10:38 am

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)
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

pjstirling
Posts: 166
Joined: Sun Nov 28, 2010 4:21 pm

Re: how use libraries without QL

Post by pjstirling » Sat Aug 15, 2015 12:24 pm

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

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: how use libraries without QL

Post by Goheeca » Sat Aug 15, 2015 2:10 pm

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)
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

Post Reply