SBCL 64bit, 1.1.7
If I want to create a package and use a little symbols from package :CL, I will create a package like this one:
(defpackage :foo
(:import-from :cl
:defun :defmacro :in-package
:null :car :cdr :cons :if
:eq))
But, in this package, if I define a function with optional arguments and called it without providing the optional arguments, I always get an error:
(defun test (&optional a))
(test)
invalid number of arguments: 0
[Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]
Restarts:
0: [RETRY] Retry SLIME interactive evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [REMOVE-FD-HANDLER] Remove #<SB-IMPL::HANDLER INPUT on descriptor 10: #<CLOSURE (COMMON-LISP:LABELS SWANK-BACKEND::RUN :IN SWANK-BACKEND:ADD-FD-HANDLER) {100490B95B}>>
3: [ABORT] Exit debugger, returning to top level.
Define a macro get the same error, but with more information:
(defmacro test (&rest body))
(test)
error while parsing arguments to DEFMACRO TEST:
invalid number of elements in
()
to satisfy lambda list
(&REST BODY):
exactly 2 expected, but 0 found
[Condition of type SB-KERNEL::ARG-COUNT-ERROR]
I think maybe it's because of lacking some symbols from :CL, so how to resolve this problem? Thanks.