How to use quicklisp when CL program is invoked as a shell script?

前端 未结 2 1751
日久生厌
日久生厌 2021-02-04 06:21

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 platfo

2条回答
  •  盖世英雄少女心
    2021-02-04 06:40

    You are doing everything right.

    Basically, before you can use quicklisp, you need to load it (currently, it's not bundled with SBCL, although it may change in the future). There are various ways to do it. For example, you can load your .sbclrc with the quicklisp init:

    #!/usr/bin/sbcl --script
    (load ".sbclrc")
    (load "my-program.lisp")
    (in-package :my-package)
    (my-main-method)
    

    or just paste those lines in your script, like you have suggested.

提交回复
热议问题