2

I could use packages installed with quick lisp: Using packages installed from quicklisp with clisp

I tried to execute the lisp code that uses packages using command line. The code is

(ql:quickload "yacc")
(use-package 'yacc)

When I tried it with clisp ex.lisp, I got this error message:

*** - READ from #<INPUT BUFFERED FILE-STREAM CHARACTER #P"ex.lisp" @2>: there
      is no package with name "QL" 

I had to use clisp < ex.lisp to load the package.

What makes the difference between the two approaches? Is clisp < ex.lisp the only way to use packages in command line?

I found this How to use quicklisp when CL program is invoked as a shell script?, but it's not for clisp.

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871
  • 2
    I suspect clisp handles init files differently in interactive and non-interactive mode, so your quicklisp setup isn't loaded when you launch with an argument. – molbdnilo Jan 07 '14 at 15:06
  • 1
    @molbdnilo -- I would second that. According to the `CLISP` man page, "No RC file will be executed", when the interpreter is started as `clisp script.lisp`. The OP should use the `-i` option to cause `setup.lisp` to be loaded. – Dirk Jan 07 '14 at 15:47

1 Answers1

1

Make a c.lisp that executes and exits the calculator.lisp.

(load "calculator.lisp")
;(in-package #:yacc-calculator)
(yacc-calculator:calculator)
(ext:exit)

Run clisp with -i: clisp -i c.lisp.

Reference

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871