Quicklisp version of SLIME, and SLIME installed through Ubuntu Software Center

950 views
Skip to first unread message

djw

unread,
Aug 3, 2013, 6:52:18 PM8/3/13
to quic...@googlegroups.com
Hi,

I'm sure this question has been asked before but I can't find evidence of it here or on the Quicklisp FAQ, etc.  That is, apologies in advance.

I'm currently using (a) Ubuntu 12.10, (b) SBCL 1.1.5, (c) GNU Emacs 24.1.1 (i686-pc-linux-gnu, GTK+ Version 2.24.12) of 2012-09-22 on panlong, modified by Debian

Before I started using Quicklisp I (first) installed and got SLIME working from Ubuntu's Software Center, and then was maintaining SLIME myself using a modified version of the emacs lisp code to point to my own directories that were easier for me to update.

Right now everything is functioning fine, so far as I know, but:

Now that I'm using Quicklisp and after running quicklisp-slime-helper (that is, invoking "
(ql:quickload "quicklisp-slime-helper")" can I safely get rid of those other directories and the original SLIME installed from Ubuntu Software Center?

My Quicklisp directory is in the default location ("~/quicklisp/") and I updated dists this morning without any drama, using
(ql:update-all-dists).

Quicklisp's version of SLIME is located at: ~/quicklisp/dists/quicklisp/software/slime-20130720-cvs

Following are some contextual details available after invoking SLIME as of a few minutes ago:

-----

After invoking SLIME, and at the initial SLIME REPL prompt, it shows:

; SLIME 2013-06-26
CL-USER>


-----

After invoking SLIME the *inferior lisp* buffer shows the following:

(progn (load "/home/dwiniecki/quicklisp/dists/quicklisp/software/slime-20130720-cvs/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.3137"))

This is SBCL 1.1.5, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
To load "cl-cairo2":
  Load 1 ASDF system:
    cl-cairo2
; Loading "cl-cairo2"
.......
To load "cl-cairo2-xlib":
  Load 1 ASDF system:
    cl-cairo2-xlib
; Loading "cl-cairo2-xlib"
............
To load "cl-colors":
  Load 1 ASDF system:
    cl-colors
; Loading "cl-colors"

To load "cl-freetype2":
  Load 1 ASDF system:
    cl-freetype2
; Loading "cl-freetype2"

*
; loading #P"/home/dwiniecki/quicklisp/dists/quicklisp/software/slime-20130720-cvs/swank-loader.lisp"
STYLE-WARNING: redefining EMACS-INSPECT (#<BUILT-IN-CLASS T>) in DEFMETHOD
STYLE-WARNING:
   Implicitly creating new generic function
   SWANK-BACKEND::STREAM-READ-CHAR-WILL-HANG-P.
WARNING: These Swank interfaces are unimplemented:
 (DISASSEMBLE-FRAME SLDB-BREAK-AT-START SLDB-BREAK-ON-RETURN)
;; Swank started at port: 40732.
40732
* STYLE-WARNING:
   redefining THREAD-FOR-EVALUATION (#<STRUCTURE-CLASS
                                       MULTITHREADED-CONNECTION>
                                     #<SB-MOP:EQL-SPECIALIZER
                                       {BC40749}>) in DEFMETHOD

-----

After invoking SLIME, the *Messages* buffer shows the following.  I'm puzzled with this because `loading' lines up to "...Error while loading 50slime: Cannot open load file..." are coming from somewhere other than my .emacs file -- I find nothing in my .emacs that attempts to load these files. (Will getting rid of SLIME from Ubuntu Software Center and my own directories clear this up?)

Loading /etc/emacs/site-start.d/00debian-vars.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done
Loading /etc/emacs/site-start.d/50gcl.el (source)...done
Loading /etc/emacs/site-start.d/50gforth.el (source)...done
Loading /etc/emacs/site-start.d/50slime.el (source)...
Error while loading 50slime: Cannot open load file: /usr/share/emacs/site-lisp/slime/slime-autoloads.el
Loading linum...done
Loading paren...done
Loading tabbar...done
Loading /home/dwiniecki/.emacs.d/color-theme-6.6.0/themes/color-theme-library.el (source)...done
Loading /home/dwiniecki/quicklisp/slime-helper.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Polling "/tmp/slime.3137" .. 1 (Abort with `M-x slime-abort-connection'.)
...
... lots of the same until finally:
...
Polling "/tmp/slime.3137" .. 49 (Abort with `M-x slime-abort-connection'.)
Connecting to Swank on port 59427..
Connected. Take this REPL, brother, and may it serve you well.

-----

Thanks for all of your expertise!

_don

Luís Oliveira

unread,
Aug 5, 2013, 1:18:28 PM8/5/13
to quic...@googlegroups.com
On Sat, Aug 3, 2013 at 11:52 PM, djw <dwin...@boisestate.edu> wrote:
> Now that I'm using Quicklisp and after running quicklisp-slime-helper (that
> is, invoking "(ql:quickload "quicklisp-slime-helper")" can I safely get rid
> of those other directories and the original SLIME installed from Ubuntu
> Software Center?

I didn't understand why loading SLIME was also loading things like
cl-cairo2, but clearing previous versions versions of SLIME as well as
anything Lisp-releated installed via Ubuntu (except perhaps for your
Lisp implementation) seems like a good idea.

HTH,

--
Luís Oliveira
http://kerno.org/~luis/

Donald Winiecki

unread,
Aug 5, 2013, 2:11:17 PM8/5/13
to quic...@googlegroups.com
Hi,

Thanks for the reply!

cl-cairo2, cl-cairo2-xlib, cl-colors, cl-freetype2 are all loaded automatically from lines in my .sbclrc file. They look like this:

----------------
(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors")
(ql:quickload "cl-freetype2")

(require 'asdf)

(require 'cl-cairo2)
(use-package 'cl-cairo2)
(require 'cl-colors)
(use-package 'cl-colors)
----------------

​I admit that, for me, Quicklisp and SLIME are magic  I really don't know how they operate.

For example, in the lines above, why do I have to require and then use cl-cairo2 and cl-colors after they have been loaded with Quicklsp? Without the require and use lines, my system doesn't work at all with the code I'm writing, which calls on cl-cairo2 and cl-colors.

Anyway, I'm shy to alter the setup to experiment with things without some idea of the outcome.

Has anyone removed an Ubuntu installation of SLIME after installing and configuring Quicklisp? If so, does SLIME run using QL's installation of SLIME?

_don




--
You received this message because you are subscribed to a topic in the Google Groups "Quicklisp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quicklisp/GqKUiSPPAwY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quicklisp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Luís Oliveira

unread,
Aug 5, 2013, 7:20:41 PM8/5/13
to quic...@googlegroups.com
On Mon, Aug 5, 2013 at 7:11 PM, Donald Winiecki
<dwin...@boisestate.edu> wrote:
> cl-cairo2, cl-cairo2-xlib, cl-colors, cl-freetype2 are all loaded
> automatically from lines in my .sbclrc file.

Oh, that's weird. You should remove that from your .sbclrc file.


> For example, in the lines above, why do I have to require and then use
> cl-cairo2 and cl-colors after they have been loaded with Quicklsp? Without
> the require and use lines, my system doesn't work at all with the code I'm
> writing, which calls on cl-cairo2 and cl-colors.

You don't have to. And you shouldn't.

Take cl-cairo2 for example. (ql:quickload :cl-cairo2) compiles and
loads the system. From this point on you can use cl-cairo2 in your
code or the REPL. For example, call (cairo:version).

The call to REQUIRE is redundant at this point. SBCL's REQUIRE hooks
into ASDF and it'll try to load CL-CAIRO, but it's already loaded.

USE-PACKAGE imports all the of symbols into the current package, which
is probably CL-USER. You should probably define your own package,
rather than use CL-USER. Have a look at
<http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html>.

You should probably also define your own system that depends on
cl-cairo2 rather than manually loading all of its dependencies via
.sbclrc or whatever. <http://www.xach.com/lisp/asdf-tutorial/> should
be useful.


> Has anyone removed an Ubuntu installation of SLIME after installing and
> configuring Quicklisp? If so, does SLIME run using QL's installation of
> SLIME?

The log you've pasted suggests that your Emacs is already loading the
version of SLIME provided by Quicklisp so you shouldn't have any
trouble with removing the Ubuntu version.

Cheers,

Donald Winiecki

unread,
Aug 5, 2013, 10:55:58 PM8/5/13
to quic...@googlegroups.com
Luis and all,

Thanks for the time you have invested in my education!  Maybe I'm closer to a proper system with the following.

From what is suggested, this is all that remains in my .sbclrc file:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Quicklisp

;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
                                    (user-homedir-pathname))))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


And this is what I have inserted into the actual program file I'm working on (ANA.lisp). This compiles (if necessary) and loads the Quicklisp dists I need, and defines a package to keep everything separate from CL-USER.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Quicklisp: Compile & load packages necessary for ANA

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Run these at the REPL to update Quicklisp dists and client.
;; They require interaction with the user if there is an actual
;; update to Quicklisp dists
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 1. Automatically get updated Quicklisp files, if available
;;    from http://www.quicklisp.org/beta/#installation
;; (ql:update-all-dists)

;; 2. Automatically get updated Quicklisp client, if available
;;    from http://www.quicklisp.org/beta/#installation
;; (ql:update-client)


(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors") ; but already loaded by cl-cairo2
(ql:quickload "cl-freetype2")


;; Details on setting up and using packages
;; http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html

;; Define a package ANA-IS-NOT-AARON, with nickname ANA, that inherits
;; all symbols exported by COMMON-LISP and CL-CAIRO2, and the suite of
;; packages loaded into CL-USER

(defpackage :ana-is-not-aaron
 (:use
  :common-lisp
  :cl-cairo2
  ;; :cl-cairo2-xlib
  :cl-colors
  ;; :cl-freetype2
  :sb-alien
  :sb-debug
  :sb-ext
  :sb-gray
  :sb-profile)
 (:nicknames :ana))

;; Make ANA the current package
(in-package :ana)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Things appear to be running as expected with these changes.  That said, I'm not sure why (in-package :ana) isn't switching to the named package in the REPL.  I can accomplish this by invoking (in-package :ana) at the REPL but it seems like I should be able to do this automatically.

'Still not brave enough to remove the Ubuntu installed SLIME.


_don

~~~~~~~~~~~~~~~~~~~~~~~~~
Don Winiecki, Ed.D., Ph.D.
Professor
Boise State University, College of Engineering
Dept of Organizational Performance & Workplace Learning (OPWL)
1910 University Drive, Boise, Idaho 83725-2070 USA
E-mail: dwin...@boisestate.edu
WWW: http://opwl.boisestate.edu
Telephone: (+01) 208 426 1899
Fax: (+01) 208 426 1970
~~~~~~~~~~~~~~~~~~~~~~~~d


Thomas Bartscher

unread,
Aug 6, 2013, 2:22:03 AM8/6/13
to quic...@googlegroups.com
There should be no need to do that. If the user already has quicklisp, he will use it himself and quicklisp handles dependencies automatically.
If the user doesn't have quicklisp, he won't be able to load the file at all even if he has all the other dependencies.



;; Details on setting up and using packages
;; http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html

;; Define a package ANA-IS-NOT-AARON, with nickname ANA, that inherits
;; all symbols exported by COMMON-LISP and CL-CAIRO2, and the suite of
;; packages loaded into CL-USER

(defpackage :ana-is-not-aaron
 (:use
  :common-lisp
  :cl-cairo2
  ;; :cl-cairo2-xlib
  :cl-colors
  ;; :cl-freetype2
  :sb-alien
  :sb-debug
  :sb-ext
  :sb-gray
  :sb-profile)
 (:nicknames :ana))

;; Make ANA the current package
(in-package :ana)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Things appear to be running as expected with these changes.  That said, I'm not sure why (in-package :ana) isn't switching to the named package in the REPL.  I can accomplish this by invoking (in-package :ana) at the REPL but it seems like I should be able to do this automatically.
IN-PACKAGE, when encountered in a file, is only effective for any text in that file after the IN-PACKAGE call.
There is the REPL-UTILITIES system available in quicklisp. Use the README macro from the same package like this:
> (repl-utilities:readme repl-utilities)
to find out how the different macros in the package work.
You should find the macro DEV there, which is nice for loading systems in the REPL.

Donald Winiecki

unread,
Aug 6, 2013, 7:59:34 AM8/6/13
to quic...@googlegroups.com
Thanks so much for your contributions!

Apologies, but I'm afraid I don't understand the statement: "There should be no need to do that. If the user already has quicklisp, he will use it himself and quicklisp handles dependencies automatically.

If the user doesn't have quicklisp, he won't be able to load the file at all even if he has all the other dependencies.
"

In particular, I'm not sure what is referenced by _There should be no need to do that_ in the statement.



After adding the lines indicated below to the top of my main program file, I still receive an error when using (dev "ana"). The error at the REPL is: Could not find system, attempting to in-package anyway. 

I think I will have to revisit <http://www.xach.com/lisp/asdf-tutorial/> to straighten myself out.

(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors") ; but already loaded by cl-cairo2
(ql:quickload "cl-freetype2")
(ql:quickload "repl-utilities")     <---------------------


(defpackage :ana-is-not-aaron
 (:use
  :common-lisp
  :cl-cairo2
  ;; :cl-cairo2-xlib
  :cl-colors
  ;; :cl-freetype2
  :sb-alien
  :sb-debug
  :sb-ext
  :sb-gray
  :sb-profile
  :repl-utilities)     <---------------------
 (:nicknames :ana))

;; Make ANA the current package - this has to be run at the REPL to make ANA's
;;  package active
(in-package :ana)


_don




--

Thomas Bartscher

unread,
Aug 7, 2013, 2:26:56 AM8/7/13
to quic...@googlegroups.com
Am Dienstag, 6. August 2013 13:59:34 UTC+2 schrieb djw:
Thanks so much for your contributions!
I am glad to be able to help.
 
Apologies, but I'm afraid I don't understand the statement: "There should be no need to do that. If the user already has quicklisp, he will use it himself and quicklisp handles dependencies automatically.
If the user doesn't have quicklisp, he won't be able to load the file at all even if he has all the other dependencies.
"
I meant the
(ql:quickload ...)
lines in your system file. They are not needed by quicklisp (because quicklisp can resolve dependencies by looking into the system definition) and they
are errounous without quicklisp (so everyone who want's to use your program not only needs your program, ASDF and its dependencies but also
quicklisp).
After adding the lines indicated below to the top of my main program file, I still receive an error when using (dev "ana"). The error at the REPL is: Could not find system, attempting to in-package anyway. 
Ah, that is because DEV does two things: It first loads the system of the pecified name and then changes to (a copy of?) the package of said name. Your
system is not called "ana" but "ana-is-not-aaron", so DEV cannot find the system specified by "ana". In short the problem is that packages and systems
are distinct and that (I think) there is no system equivalent to package nicknames.
 

I think I will have to revisit <http://www.xach.com/lisp/asdf-tutorial/> to straighten myself out.

(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors") ; but already loaded by cl-cairo2
(ql:quickload "cl-freetype2")
(ql:quickload "repl-utilities")     <---------------------
As the name of the system suggests, "repl-utilities" is meant to be used at the REPL. I would advice you to load and use the package in your .sbclrc as
REPL-UTILITIES is really needed while developing and not while running a program.
I think DEV automatically adds REPL-UTILITIES to the use list of the package you will be in after using DEV.
 
(defpackage :ana-is-not-aaron
 (:use
  :common-lisp
  :cl-cairo2
  ;; :cl-cairo2-xlib
  :cl-colors
  ;; :cl-freetype2
  :sb-alien
  :sb-debug
  :sb-ext
  :sb-gray
  :sb-profile
  :repl-utilities)     <---------------------
ANA-IS-NOT-AARON doesn't really depend on REPL-UTILITIES, so I think it is a bad idea to include it in the packages use list.
See my previous comment: DEV should do the using for you.

Donald Winiecki

unread,
Aug 7, 2013, 7:56:33 AM8/7/13
to quic...@googlegroups.com
Thanks again for your investment in my education!  It is most appreciated..

Unfortunately, removing the following from my program file also renders the program unusable.

(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors")
(ql:quickload "cl-freetype2")
(ql:quickload "repl-utilities")  
 

When attempting to load the program without the lines above, the following error is output:

The name "CL-CAIRO2" does not designate any package.
   [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]


And after restoring the (ql:quickload... lines noted above, (dev :ana-is-not-aaron) returns the same error at the repl:Could not find system, attempting to in-package anyway.

However the following at the repl (but not in the program file itself) is successful -- the package is now in use and the repl prompt is now ANA> instead of CL-USER>, even though the same error is reported at the repl. So it appears that, that for some reason, the quickload of repl-utilities is not having the expected effect.

(repl-utilities:dev :ana-is-not-aaron)

Could not find system, attempting to in-package anyway.
NIL
ANA>

When I move (ql:quickload "repl-utilities") into my .sbclrc file and out of my program file, I receive errors indicating a problem with the program file itself at the end of this line (in-package :ana).

All of this is confounding. There is obviously more -- and less -- happening than I am currently able to articulate.

In practice, this program will probably never be run by anyone but myself. For this reason I am not concerned at this point about dependencies, so long as the system operates on my own equipment.

These are the forms of present interest, in my program file (ana.lisp)

(ql:quickload "cl-cairo2")
(ql:quickload "cl-cairo2-xlib")
(ql:quickload "cl-colors")         ;but already loaded by cl-cairo2
(ql:quickload "cl-freetype2")
(ql:quickload "repl-utilities")    ;Quicklisp utilities package


(defpackage :ana-is-not-aaron
  (:use
   :common-lisp
   :cl-cairo2                      ;cl-cairo2 package
   :cl-colors                      ;cl-colors package
   :sb-alien                       ;sb-alien specific to SBCL
   :sb-debug                       ;sb-debug specific to SBCL
   :sb-ext                         ;sb-ext specific to SBCL
   :sb-gray                        ;sb-gray specific to SBCL
   :sb-profile                     ;sb-profile specific to SBCL
   :repl-utilities)                ;Quicklisp utilities package
  (:nicknames :ana :sbcl-ana))

(in-package :ana)


These are the only lines active in my .sbclrc file


;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
                                    (user-homedir-pathname))))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)))


_don

Thomas Bartscher

unread,
Aug 8, 2013, 2:06:53 AM8/8/13
to quic...@googlegroups.com
All of this seems to me as if you aren't using ASDF for your project - I just assumed you used it.
Quicklisp uses ASDF underneath to describe, what a system is. The same goes for REPL-UTILITIES:DEV. Both are using ASDF to find all the systems
installed on your computer and then load those systems. I am not currently at my own computer and I don't quite exactly remember how I set up my ASDF
so if you would like to use DEV (which is a really quite nice command) and might want to learn how to prepare your programs/libraries for distribution, have
a look into the ASDF manual.

I *can* tell you, that you need to put an *.asd file into a directory that ASDF knows. For your ana-is-not-aaron project you wil need to name the file
ana-is-not-aaron.asd
In that file you write something like the following:


(in-package #:asdf) ; this might be considered bad practice but should be fine of you aren't using ASDFs advanced features

(defsystem "ana-is-not-aaron" ; this needs to be the same name you chose for the file
  :author "don"
  :depends-on ("cl-cairo2" "cl-colors")
  :components
  ((:file "file-that-is-in-th-same-folder-as-the-asd-file-without-file-extension")
   (:module
    "subfolder"
    :depends-on () ; put here all the files this module needs to be loaded before its components are
    :components
    ( ; the same as the outer components, only now you are describing files in "subfolder"
     ))
   ))


The ASDF manual is a lot more helpful in this regard. After you have written this file and made it available to ASDF and reinitialized ASDF the errors
regarding missing systems shouldn't occure anymore and you should be able to get rid of the
(ql:quickload ...)
lines, as the
  :depends-on (...)
is used by quicklisp to determine which other systems need to be loaded before your system can be loaded.

Donald Winiecki

unread,
Aug 8, 2013, 7:05:13 AM8/8/13
to quic...@googlegroups.com
Thank you Thomas. I have homework to do so that I may better understand and use the information you are providing.

Best,

_don


Donald Winiecki

unread,
Aug 8, 2013, 8:19:20 PM8/8/13
to quic...@googlegroups.com
Thomas,

If you have the chance, I would be happy to see how you have set up ASDF on your system. 

Best,

_don


Thomas Bartscher

unread,
Aug 11, 2013, 7:54:08 AM8/11/13
to quic...@googlegroups.com
Make a directory like this in the shell:

mkdir ~/.config/common-lisp/source-registry.conf.d/

This folder should be searched by ASDF for files describing where systems can be found.
You name the files like this:
01-foo.conf
02-bar.conf
...
The first number of the file describes the files priority. If a system is found via 01-foo,conf it won't be searched in 02-bar.conf. At least that is what I hope.

I have the following files:
01-dev-systems.conf for stuff I am currently working on and
02-local-systems.conf for systems not provided by quicklisp.
All the system you load via quicklisp you don't need to explicitely mention, quicklisp seems to know either way, where it keeps its downloaded systems.

My 01-dev-systems.conf looks like this:

(:tree "/home/thomas/programming/common-lisp/")

This tells ASDF that anything in that folder and its subfolders has to be searched for systems.
02-local-systems.conf looks like this:

(:tree "/usr/lib/lisp/")

Those files need to be present when ASDF is loaded (with SBCL that is when SBCL itself is started). I guess ASDF does caching on startup.

I hope that helped.

Zach Beane

unread,
Aug 11, 2013, 7:57:14 AM8/11/13
to quic...@googlegroups.com
I usually just stick projects in ~/quicklisp/local-projects/, where they
are found automatically without any additional ASDF configuration.

Zach

Thomas Bartscher

unread,
Aug 11, 2013, 8:33:16 AM8/11/13
to quic...@googlegroups.com, xa...@xach.com
I don't do that because I installed quicklisp system wide but projects I work on shouldn't be available for other users.
Not that there actually are other users. *cough*

Elias Mårtenson

unread,
Aug 11, 2013, 9:56:47 AM8/11/13
to quic...@googlegroups.com, xa...@xach.com
On Sunday, 11 August 2013 20:33:16 UTC+8, Thomas Bartscher wrote:
I don't do that because I installed quicklisp system wide but projects I work on shouldn't be available for other users.
Not that there actually are other users. *cough*

Has anyone ever even considered having a system-wide installation of Quicklisp? Why would you even do that?

You might have a system-wide QL _distribution_ that local QL installation can pull software from. That would be much more in line with the conceptual design of QL.

Zach Beane

unread,
Aug 11, 2013, 9:58:34 AM8/11/13
to Elias Mårtenson, quic...@googlegroups.com
Some people have done it. Quicklisp isn't really written with that
use-case in mind, but it *can* be done.

Zach

Donald Winiecki

unread,
Aug 11, 2013, 12:35:24 PM8/11/13
to quic...@googlegroups.com
First, apologies for the long posting. I very much want to get things working to conform with assumptions of ASDF and Quicklisp.

Second, thank you all for your contributions!

Third, now that I'm trying to conform my expectations and my installation to fit the assumptions and intentions of ASDF and Quicklisp (consistent with what Zach has written in http://www.xach.com/lisp/asdf-tutorial/ and that Zach, Thomas and Luis have added in this thread), I can gain success in some ways but not in others.

First, the success:

Following the example in http://www.xach.com/lisp/asdf-tutorial/ I have produced the following .lisp and .asd files.

This works as expected when I follow the process indicated in http://www.xach.com/lisp/asdf-tutorial/.  This success seems to indicate that ASDF and Quicklisp are properly installed and configured.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; clprojecttest.lisp

(defun my-define-package ()
  (defpackage #:clprojecttest
    (:use
     #:common-lisp
     #:cl-cairo2                                      ; cl-cairo2 just to see if I can include it
     #:cl-colors                                      ; cl-colors just to see if I can include it
     #:repl-utilities)
    (:nicknames :clpt :test)))
(my-define-package)

(defun my-in-package ()
  (in-package #:clprojecttest))
(my-in-package)

(defun add-2-to-input (input)
  (+ 2 input))

;; end clprojecttest.lisp ;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; clprojecttest.asd
;; I want to be able to use either SBCL or CLISP -- these may be different defsystem specs
;;  at some point.

#+sbcl
(asdf:defsystem #:clprojecttest
  :depends-on (#:cl-cairo2
           #:cl-colors
           #:repl-utilities)
  :components ((:file "clprojecttest")))
#+clisp
(asdf:defsystem #:clprojecttest
  :depends-on (#:cl-cairo2
           #:repl-utilities)
  :components ((:file "clprojecttest")))

;; end clprojecttest.asd ;;;;;


Now the non-success:

Trying to adapt the above to my ANA.lisp program I have produced ANA.asp to go along with ANA.lisp.  I'm attaching ANA.lisp and including what I believe to be the relevant components of ANA.lisp below for reference.

In ANA.lisp, I shouldn't have to have the code in MY-REQUIRE-OR-LOAD-FUNCTION, but if it's not here, neither SBCL or CLISP will load the program -- errors occur indicating that the required packages can't be found.

As shown and attached here, after launching SBCL or CLISP in SLIME and changing to the relevant directory, ANA.lisp loads.  When it does so using SBCL, there is no feedback until the load succeeds with `T' and returns to the REPL prompt.  When it does so using CLISP, the REPL reports Quickloading the packages in MY-REQUIRE-OR-LOAD-FUNCTION (below) before returning ``T'' and showing the REPL prompt.

When loading with SBCL before SLIME returns ``T'' there is a delay about as long as is the process of Quickloading the four packages named in MY-REQUIRE-OR-LOAD-FUNCTION below.  I am guessing this means that the same general process occurs whether SBCL is using ``(require "...")'' or CLISP is using ``(ql:quickload "...")''.

At this point I can ``(in-package :ANA)'' or ``(in-package :ana)'' to make the package active. ANA.lisp can then be run successfully in either SBCL or CLISP (and did so without ANA.asd).

If I attempt ``(dev :ANA)'' instead of ``(in-package :ANA)'', at the REPL, it indicates ``Could not find system, attempting to in-package anyway.'' The ``in-package'' succeeds and the REPL prompt changes to ANA>  At that point, the program is functional.

If I remove MY-REQUIRE-OR-LOAD-FUNCTION and attempt to follow the process in http://www.xach.com/lisp/asdf-tutorial/, I receive an error indicating that it cannot find cl-cairo2.

With all of this, I still have an operational program without ANA.asd and without a ``proper'' use of Quicklisp.

Several puzzles for me with which I would very much appreciate some help (and tolerance of):

1. What is making it so that ANA (below and attached) does not work as does CLPROJECTTEST (above)?

2. With the proviso that I very much want to understand what is happening here so that I might make my current and future programming more robust, maintainable and portable -- given that I now have a functional program that I can continue to develop for my own research, what do I gain by getting ANA to behave as does CLPROJECTTEST?

I am also attaching my .sbclrc and .clisprc.lisp (at text files ``sbclrc.txt'', ``clisprc.lisp.txt'') so you can see what I'm doing there.

** A bit of personal history. I am a Sociologist and an Artist. I am self-taught at programming, having worked through Touretzky's book before commencing this project. I started Touretzky in January 2013 and began working on ANA in April 2013. I chose lisp for my current work because of some conversations with someone else working on a similar project, who uses Allegro CL. For various reasons I wish to stay with open-source tools and I have since come to find that they allow more flexibility for my particular purposes than does Allegro CL anyway.

All of that is to say that when it comes to programming and lisp I am something of a wise-guy (in the original sense) -- I probably should not know what I know and at any rate am not always certain of myself when coding.  At least I know to back-up my work and keep a copy of functional program before tinkering further with things.

Thanks for your continued tolerance and for any assistance you might choose to offer.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ANA.asd

#+sbcl
(asdf:defsystem #:ANA            ;ana-is-not-aaron
  :author "Don Winiecki"
  :depends-on (#:cl-cairo2
           ;; #:cl-cairo2-xlib
           #:cl-colors
           ;; #:cl-freetype2
           #:sb-alien
           #:sb-debug
           #:sb-ext
           #:sb-gray
           #:sb-profile
           #:repl-utilities)
  :components ((:file "ANA")))
#+clisp
(asdf:defsystem #:ANA            ;ana-is-not-aaron
  :author "Don Winiecki"
  :depends-on (#:cl-cairo2
           ;; #:cl-cairo2-xlib
           #:cl-colors
           ;; #:cl-freetype2
           ;; #:ext
           #:repl-utilities)
  :components ((:file "ANA")))

;; end ANA.asd ;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ANA.lisp

(defun my-require-or-load-function ()
  "MY-REQUIRE-OR-LOAD-FUNCTION adapts how required packages are added to the running image. If SBCL is the running lisp, use (require "...") only. If CLISP (or any other lisp) is running, use (ql:quickload...) to load packages. If any other lisp, use (ql:quickload...) to load packages (08062013)."
  ;; if SBCL is active, use ``require'' only
  (cond ((equal "SBCL" (lisp-implementation-type))
     (require "cl-cairo2")
     (require "cl-cairo2-xlib")
     (require "cl-colors")                 ;but already part of cl-cairo2
     (require "cl-freetype2"))
    ;; if CLISP is active, Quickload (because I haven't figured out how
    ;;  to get CLISP to play nice, like SBCL)
    ((equal "CLISP" (lisp-implementation-type))

     (ql:quickload "cl-cairo2")
     (ql:quickload "cl-cairo2-xlib")
     (ql:quickload "cl-colors")         ;but already part of cl-cairo2
     (ql:quickload "cl-freetype2"))
    ;; if any other lisp is active, emit error that tells me I'm trying
    ;;  to use an unfamiliar lisp
    (t
     (format t "ERROR! You haven't configured ANA to work with ~S yet.~%"
         (lisp-implementation-type))
     (format t "Add package loading specs for ~S at MY-REQUIRE-OR-LOAD-FUNCTION ~%~%"
         (lisp-implementation-type))
     (error "This lisp not yet implemented for ANA. See problem specfics in the REPL."))))
;; call MY-REQUIRE-OR-LOAD-FUNCTION
(my-require-or-load-function)


(defun my-package-definition-function ()
  "MY-PACKAGE-DEFINITION-FUNCTION identifies the current lisp and sets up a package definition specific for that lisp (08072013)."
  ;; if it's SBCL, define package to include SBCL special packages
  #+sbcl
  (defpackage #:ANA             ;ana-is-not-aaron
    (:use
     #:common-lisp
     #:cl-cairo2             ;cl-cairo2 package
     ;; #:cl-cairo2-xlib
     #:cl-colors             ;cl-colors package
     ;; #:cl-freetype2
     #:sb-alien                 ;sb-alien specific to SBCL
     #:sb-debug                 ;sb-debug specific to SBCL
     #:sb-ext                 ;sb-ext specific to SBCL
     #:sb-gray                 ;sb-gray specific to SBCL
     #:sb-profile             ;sb-profile specific to SBCL
     #:repl-utilities)             ;Quicklisp utilities package
    (:nicknames :ana-is-not-aaron :sbcl-ana))
  ;; if it's CLISP, define package to include CLISP special packages
  #+clisp
  (defpackage #:ANA             ;ana-is-not-aaron
    (:use
     #:common-lisp
     #:cl-cairo2
     ;; #:cl-cairo2-xlib
     #:cl-colors
     ;; #:cl-freetype2
     ;; #:ext                ;ext specific to CLISP
     #:repl-utilities)             ;Quicklisp utilities package
    (:nicknames :ana-is-not-aaron :clisp-ana))
  ;; for any other implementation, emit error that tells me I'm trying
  ;;  to use an unfamiliar lisp
  #-(or sbcl clisp)
  ((format t "ERROR! You haven't configured ANA to work with ~S yet.~%"
       (lisp-implementation-type))
   (format t "Add package definition specs for ~S at MY-PACKAGE-DEFINITION-FUNCTION~%~%"
      (lisp-implementation-type))
   (error "This lisp not yet implemented for ANA. See problem specfics in the REPL.")))
;; call MY-PACKAGE-DEFINITION-FUNCTION
(my-package-definition-function)

; ... program continues

;;;;;; end ;;;;;;

Best,

_don




sbclrc.txt
ANA.lisp

danlentz

unread,
Aug 11, 2013, 8:20:52 PM8/11/13
to quic...@googlegroups.com
Don't do defpackage inside my package definition function. The reader conditionals #+SBCL (defpackage ....
are sufficient. Defpackage (and typically all things that look like def-foo) is a macro -- these are called top-level-forms
and should rarely or ever be used otherwise. If you really wanted to define your package as a side effect during the
evaluation of some function, you would use the function make-package and then all of the other assorted package
munging functions to adjust it's configuration as needed. This is because make-package itself only supports a very limited amount of
options -- it is not really the typical way you would do this. Defpackage, on the other hand, provides a declarative interface
To the full range of possible package configuration.

Also, the compiler guarantee that if you have defpackage as a top level form in your source file, then at any point afterwards
you can say (in-package :foo) and not have to deal with any worries about dealing with the complexities of understanding
read-time vs compile-time vs execute time phases of how your lisp compiler is actually doing this for you.

Hope this could help. I know there are any number of people on this group who no doubt can point you in the right direction
but understanding the times at which various different phases of evaluation occur (most importantly macro-expansion vs evaluation)
Is an important concept you will need to understand in order to work effectively in CL, otherwise you are likely going to run into any
Number of situations where things just won't work for seemingly no apparent reason.

Regards,
Dan

Donald Winiecki

unread,
Aug 12, 2013, 3:47:10 PM8/12/13
to quic...@googlegroups.com
Hi again,

I want to thank everyone in the Quicklisp GoogleGroup for their active participation and/or tolerance in my questions up to this point. This goes especially to Luís Oliveira, Thomas Bartscher, Dan Lentz and Zach Beane.

Taking everyone's comments on board, and building upon the documentation available, I have been developing and testing my knowledge and understanding of Quicklisp, its assumptions and what appear to be acceptable practices for using it. 

I have ultimately been successful in producing a system and set of .fasl files (for SBCL and CLISP) that operate reliably, and which seem to be consistent with the advice most recently provided to me in this group.

I must say that while I have things working, my knowledge and understanding is still fragile. I will be preparing documents for myself to (hopefully) congeal what I have learned into something that I can more readily control and manipulate.

(We will see how well I `get it' when I try to get things working on my home-office computer!)

Best wishes and I look forward to being able to ask more intelligent questions, not have to ask (many) questions at all, and ultimately give back to the group.

_don



Thomas Bartscher

unread,
Aug 13, 2013, 1:54:03 AM8/13/13
to quic...@googlegroups.com
I can't say much because now I am lost, but here is where I would look first


Am Sonntag, 11. August 2013 18:35:24 UTC+2 schrieb djw:
2. With the proviso that I very much want to understand what is happening here so that I might make my current and future programming more robust, maintainable and portable -- given that I now have a functional program that I can continue to develop for my own research, what do I gain by getting ANA to behave as does CLPROJECTTEST?
This will allow you to easily include your project in future projects. Although that might not be needed with ANA because it is only a toy project the matter is important enough (I think) that you might want to learn it now rather than learning it when it can't be avoided.
Also doing this eases usage of what you do for others.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ANA.asd

#+sbcl
(asdf:defsystem #:ANA            ;ana-is-not-aaron
  :author "Don Winiecki"
  :depends-on (#:cl-cairo2
           ;; #:cl-cairo2-xlib
           #:cl-colors
           ;; #:cl-freetype2
           #:sb-alien
           #:sb-debug
           #:sb-ext
           #:sb-gray
           #:sb-profile
           #:repl-utilities)
  :components ((:file "ANA")))
You do not need to depend on all the sb-* systems because there is no such thing. ASDF loads systems, not packages.
Systems describe what files to load how and in which order, packages are collections of symbols.
There is no such thing as a sb-alien system, so trying to load that system should throw an error. Keep in mind that sbcl already loaded the
corresponding files on startup so the packages defined by those files are already available without any further action by you.
Why loading the system tells you that cl-cairo2 isn't available I have no idea.

Donald Winiecki

unread,
Aug 13, 2013, 8:03:02 AM8/13/13
to quic...@googlegroups.com
Thank you Thomas,

I apologise because surely I am the one who is actually lost (but with your own, and others' help I am gradually finding my way). Lack of specific knowledge and understanding leads one  to ask confounded questions and make improper assumptions, but the only way I increase my knowledge is with the guidance of those who make their knowledge and understanding available.

You are correct in identifying my misunderstanding that sb-alien, sb-debug, sb-ext, sb-gray, sb-profile could be loaded by ASDF using Quicklisp. When, after loading SBCL, I saw that those packages were active, I thought they were then necessary when using SBCL. After reading more closely the materials which led me to find those sb-* packages in the first place I now see that COMMON-LISP-USER inherits symbols from them and thus, it is not necessary to pull them into a new system that always already incorporates COMMON-LISP-USER.

I still cannot say why or how CL-CAIRO2 was not loaded.

I can say that sometimes this happens and when it does, if I then (load "ana.lisp"), and then attempt to (require 'ana) again, the process succeeds.

But at the same time, the system cl-freetype2 is still not being treated in the same way as cl-cairo2 and cl-colors. When cl-freetype2 is included in my defpackage, it fails every time, even while cl-cairo2 and cl-colors succeed.

Best,

_don
~~~~~~~~~~~~~~~~

;; ana.asd

#+sbcl
(asdf:defsystem #:ana              ;ana-is-not-aaron
  :author "Don Winiecki <donwi...@yahoo.com> <dwin...@boisestate.edu>"
  :depends-on (#:cl-cairo2
           ;; #:cl-cairo2-xlib    ; already included in cl-cairo2
           #:cl-colors
           #:cl-freetype2
           ;; #:sb-alien          ; sb-* already included by sbcl in cl-user
           ;; #:sb-debug          ; sb-* already included by sbcl in cl-user
           ;; #:sb-ext            ; sb-* already included by sbcl in cl-user
           ;; #:sb-gray           ; sb-* already included by sbcl in cl-user
           ;; #:sb-profile        ; sb-* already included by sbcl in cl-user
           #:repl-utilities
           )
  :components ((:file "ana")))
#+clisp
(asdf:defsystem #:ana              ;ana-is-not-aaron
  :author "Don Winiecki <donwi...@yahoo.com> <dwin...@boisestate.edu>"
  :depends-on (#:cl-cairo2
           ;; #:cl-cairo2-xlib    ; already included in cl-cairo2
           #:cl-colors
           #:cl-freetype2
           ;; #:ext               ; already included by clisp in cl-user
           #:repl-utilities)
  :components ((:file "ana")))


;; ana.lisp
.
.
.
;; This block of code identifies the currently-running lisp and sets up a

;;   package definition specific for that lisp (08072013)."
;; if it's SBCL, define package to include SBCL special packages
#+sbcl
(defpackage #:ana             ;ana-is-not-aaron
  (:use
   #:common-lisp
   #:cl-cairo2                     ;cl-cairo2
   ;; #:cl-cairo2-xlib
   #:cl-colors                     ;cl-colors
   ;; #:cl-freetype2                 ;cl-freetype2
   ;; #:sb-alien             ;sb-alien loaded by SBCL into cl-user
   ;; #:sb-debug             ;sb-debug loaded by SBCL into cl-user
   ;; #:sb-ext                 ;sb-ext loaded by SBCL into cl-user
   ;; #:sb-gray                 ;sb-gray loaded by SBCL into cl-user
   ;; #:sb-profile             ;sb-profile loaded by SBCL into cl-user
   #:repl-utilities               ;Quicklisp utilities package
   )

  (:nicknames :ana-is-not-aaron :sbcl-ana))
;; if it's CLISP, define package to include CLISP special packages
#+clisp
(defpackage #:ana             ;ana-is-not-aaron
  (:use
   #:common-lisp
   #:cl-cairo2                     ;cl-cairo2
   ;; #:cl-cairo2-xlib
   #:cl-colors                     ;cl-colors

   ;; #:cl-freetype2
   ;; #:ext                        ;ext specific to CLISP
   #:repl-utilities             ;Quicklisp utilities package
   )

  (:nicknames :ana-is-not-aaron :clisp-ana))
;; for any other implementation, emit error that tells me I'm trying
;;  to use an unfamiliar lisp
#-(or sbcl clisp)
((format t "ERROR! You haven't configured ANA to work with ~S yet.~%"
     (lisp-implementation-type))
 (format t "Add package definition specs for ~S at MY-PACKAGE-DEFINITION-FUNCTION~%~%"
     (lisp-implementation-type))
 (error "This lisp not yet implemented for ANA. See problem specfics in the REPL."))


;; This block of code calls the ``in-package'' macro to make ANA
;;  (aka ANA-IS-NOT-AARON) the current package - this or the following has to be run at the
;;  REPL to make ANA's package active (08082013)
;;
;; (dev :ana)

(in-package #:ana)

.
.
.


--

Donald Winiecki

unread,
Aug 14, 2013, 7:21:28 AM8/14/13
to quic...@googlegroups.com
After
​learning more about how to decode the error messages provided by the system (very comprehensive once I start to get a clue!), I figured the situation where (require 'ana) failed, but then could succeed after (load "ana.lisp"), was related to a macro that wasn't being expanded as I expected at compile-time.

I rewrote the macro as a function and it fixed the issue.

​Best,

_don
Reply all
Reply to author
Forward
0 new messages