Lisp HUG Maillist Archive

Drakma: Compile-load not OK, but load then compile-load OK

In my startup file, I think the relevant lines are:

 

(load "~/quicklisp/setup.lisp")

(ql:quickload "drakma")

 

 

In LispWorks menus, I do

File >> Load >> my-startup-file.lisp

 

and Drakma loads without error.

 

 

But if I start LispWorks fresh, then do:

File >> Compile and Load >> my-startup-file.lisp

 

then amongst the output, I get:

 

**++++ Error between functions:

  Reader cannot find package QL.

 

and I get:

 

; *** 1 error detected, no fasl file produced.

;;; Compilation finished with 0 warnings, 1 error, 0 notes.

 

 

 

However, I can start LispWorks fresh and do

File >> Load >> my-startup-file.lisp

and then

File >> Compile and Load >> my-startup-file.lisp

 

 

 

I am thinking maybe somebody from Lisp HUG can help me understand

  1. Why can I not do a compile and load first without error?
  2. Is something I can put in my-startup-file.lisp that would allow compile and load first?
  3. Does the phenomenon indicate I may have set up Quicklisp or Drakma improperly?

 

I learned that compiling Lisp allows infinite tail recursion. I was unaware of any potential problems compiling and loading. But now, I see that there could be a problem with compiling and loading.

 

So, I hope for someone to help my understanding.

 

 

Ron Lewis

Baltimore, MD

USA

 

 

Re: Drakma: Compile-load not OK, but load then compile-load OK



On Apr 13, 2018, at 2:34 PM, Ron Lewis <rlewis-4d@indinfer.com> wrote:

In my startup file, I think the relevant lines are:
 
(load "~/quicklisp/setup.lisp")
(ql:quickload "drakma”)

Too late. First Lisp reads startup.lisp, then it runs it. It’s breaking when reading (ql:quickload …) before executing the load.

To force the load to occur while Lisp is reading the file, use 

#-quicklisp
(eval-when (:compile-toplevel :load-toplevel :execute)
  (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
    (when (probe-file quicklisp-init)
      (load quicklisp-init))))

This is what add-to-init-file does.  Quicklisp documentation.
 

------------------
Christopher Riesbeck
Home page: http://www.cs.northwestern.edu/~riesbeck
Calendar: http://www.cs.northwestern.edu/~riesbeck/calendar.html


Updated at: 2020-12-10 08:30 UTC