Skip to content

Allow defining *QUICKLISP-HOME* in the REPL.#28

Closed
tmtvl wants to merge 2 commits into
rudolfochrist:masterfrom
tmtvl:master
Closed

Allow defining *QUICKLISP-HOME* in the REPL.#28
tmtvl wants to merge 2 commits into
rudolfochrist:masterfrom
tmtvl:master

Conversation

@tmtvl

@tmtvl tmtvl commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Allows users to define QUICKLISP-HOME in the REPL before loading ql-setup.lisp; which makes it easier to install it to a different directory.

Allows users to define *QUICKLISP-HOME* in the REPL before loading ql-setup.lisp; which makes it easier to install it to a different directory.
Comment thread ql-setup.lisp Outdated
;; and contains the call to setup.

(in-package #:common-lisp-user)
(export '*quicklisp-home*)

@rudolfochrist rudolfochrist Jul 1, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary and can be removed. The *quicklisp-home* symbol must not be exported to be accessed.

Comment thread ql-setup.lisp Outdated
(defvar *quicklisp-home*
(make-pathname :name nil :type nil
:defaults (let ((qlhome "~/quicklisp/"))
(when (boundp 'cl-user:*quicklisp-home*)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use :: to access unexported symbols: cl-user::*quicklisp-home*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that, interesting. I don't know how I feel about being able to access internal symbols, but in this case it'd be useful.

@rudolfochrist

Copy link
Copy Markdown
Owner

Thank you for your submission!

Unfortunately, I don't fully understand the purpose of this change? Can you elaborate your workflow? Especially, why do you need to change the value of *quicklisp-home* in the REPL?

I assume this is more a configuration issue. Usually you add this code to your lisp's init file:

(let ((quicklisp-init #p"~/common-lisp/ql-https/ql-setup.lisp"))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)
    (asdf:load-system "ql-https")
    (uiop:symbol-call :quicklisp :setup)))

If you want to change quicklisp's install location, you need the change *quicklisp-home* before the call to setup:

(let ((quicklisp-init #p"~/common-lisp/ql-https/ql-setup.lisp"))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)
    (setf ql-setup:*quicklisp-home* #p"/path/to/quicklisp/") <-- here
    (asdf:load-system "ql-https")
    (uiop:symbol-call :quicklisp :setup)))

The last 4 lines of the code snippet above can also be used in the REPL (without the let), so I don't think the indirection using a symbol in the CL-USER package is really necessary.

@tmtvl

tmtvl commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

My use case is I want to use a custom Quicklisp home directory (so I don't need to have a Quicklisp directory in my home directory) and I want to use ql-https from my initfile (.sbclrc). If I load ql-setup as it is then it errors because it wants to load Quicklisp from $HOME/quicklisp. Having that happen when I want to use SBCL non-interactively to run a script is annoying. Currently I'm working around it by defining the ql-https package in my init file and setting quicklisp-home before loading ql-setup, but being able to define quicklisp-home in the cl-user package and having it autoload from there would be more convenient.

@tmtvl

tmtvl commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

I guess the better option would be to defer the path verification from the variable definition to wherever *quicklisp-home* is first needed, so the user gets the option to change ql-https:*quicklisp-home* before being warned if the *quicklisp-home* value is unusable.

@rudolfochrist

Copy link
Copy Markdown
Owner

This can be closed in favour of #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants