读取终端参数并在 lisp 中传递函数?

Read terminal argument and pass the function in lisp?

(defun gppinterpreter (filename)
    (setq fileContent (read-a-file filename))
    (write filecontent)
)
(gppinterpreter filename)

我在ubuntu

中编译这个文件

剪辑 example.lisp

我想直接从终端获取filename参数比如>> clisp example.lisp filename

但是这个命令不起作用。如何从终端

获取gppinterpreter中的文件名参数

在 Clisp 中,程序参数在变量 EXT:*ARGS*. 中给出。

https://clisp.sourceforge.io/impnotes/clisp.html

Before it is loaded, the variable EXT:ARGS is bound to a LIST of STRINGs, representing the arguments given to the Lisp script (i.e., in /bin/sh becomes (FIRST EXT:ARGS) etc).

所以我想你想使用 (second EXT:*ARGS*)