Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test if quicklisp has already been installed in clisp

I'm working on a project in Common Lisp which makes use of a package installed with quickload. I'm making a bash script in the root of the project which tests if the necessary programs are installed, and if it all checks out, it runs a lisp script which loads my project. I want some way of testing if quicklisp is installed, so that I can have it can ask the user for permission to download and install quicklisp automatically. Is there a way to test for this? Quicklisp is installed within clisp, not as a package on the OS, so using the bash builtins for testing if a program's installed won't work.

like image 949
Sotanaht Avatar asked Jan 28 '26 08:01

Sotanaht


1 Answers

From inside Lisp: Quicklisp puts :quicklisp onto the cl:*features* list. If Quicklisp is already loaded into Lisp, then this symbol is on the *features* list.

To test that:

(member :quicklisp *features*)

In Lisp code you can also use the conditional reader:

#+quicklisp (print "quicklisp installed")

or

#-quicklisp (print "quicklisp not installed")
like image 166
Rainer Joswig Avatar answered Jan 30 '26 20:01

Rainer Joswig



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!