Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use quicklisp when CL program is invoked as a shell script?
    primarykey
    data
    text
    <p>I am currently have a small program in Common Lisp, which I want to run as a shell script. I am using the SBCL and perfectly fine with this so will prefer to stay on this platform. :)</p> <p>I am aware about the <code>--script</code> option and it works flawlessly except for <code>(ql:quickload)</code> form.</p> <p>My program uses the <a href="http://weitz.de/cl-fad/" rel="nofollow">CL-FAD</a>, which loads through <code>ql:quickload</code> (I think I should mention that it is package-loading function from <a href="http://www.quicklisp.org/" rel="nofollow">quicklisp</a>). When script runs up to evaluating the</p> <pre><code>(ql:quickload :cl-fad) </code></pre> <p>form, it breaks with the next error:</p> <pre><code>package "QL" not found </code></pre> <p>Program is packed in the single source file, which has following header:</p> <pre><code>(defpackage :my-package (:use :common-lisp) (:export :my-main-method)) </code></pre> <p>It is simple automation executable, so I decided (maybe erroneously) not to write any ASDF system. It exports single function which should be run without any arguments.</p> <p>For this program I am currently trying to write the launcher script, and this is what I am staring at:</p> <pre><code>#!/usr/bin/sbcl --script (load "my-program.lisp") (in-package :my-package) (my-main-method) </code></pre> <p>This three lines (not counting the shebang) is what I am want to automate. As I read in documentation, script with this shebang can be called as simple <code>./script.lisp</code>, and it really does this... with the error described before.</p> <p>What I need to add in the launcher for <code>:cl-fad</code> to load properly? Documentation states that with <code>--script</code> option SBCL doesn't load any init file, so do I really need to copypaste the lines</p> <pre><code>#-quicklisp (let ((quicklisp-init (merge-pathnames "systems/quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init))) </code></pre> <p>(which <code>ql:add-to-init-file</code> adds to .sbclrc), to my launcher script? Maybe I have some deep architectural flaw in my program setup?</p> <p>And yes, when I enter the lines which I try to automate in REPL in the sbcl itself, program runs as expected.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload