通常のパラメーターとオプションのパラメーター n を使用して、LISP でこの関数を使用しています。
(defun lastplus (x &optional (n 0)) //default value for n is 0
( if (listp x) //if x is a list
(
(list (length x) (n)) //return list that contains length(x) and n
)
(n) //else return n
)
)
リスナー ファイルで関数を使用しようとしていますが、次のエラーが表示されます。
CL-USER 13 : 4 > (lastplus 2 8)
Error: Undefined function N called with arguments ().
私はLispWorks 6.0.1を使用しています
なぜこのエラーが発生するのか知っていますか?