On Wed, 16 Feb 2005, Cyrus Harmon wrote:
> I often find that I get errors such as the following:
> invalid number of arguments: 2
> [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]
Shh! It's a secret:
* (defun one-arg-fun (x) (list x))
* (one-arg-fun 1 2)
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread 84138:
invalid number of arguments: 2
You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT ] Reduce debugger level (leaving debugger, returning to toplevel).
1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
("XEP for COMMON-LISP-USER::ONE-ARG-FUN" 2 1)[:EXTERNAL]
source: (SB-INT:NAMED-LAMBDA ONE-ARG-FUN (X) (BLOCK ONE-ARG-FUN (LIST X)))
^-- The XEP above, while possible mysterious should also be suggestive...
If in doubt, looking at the backtrace may also yeild illumination:
0] ba 1
0: ("XEP for COMMON-LISP-USER::ONE-ARG-FUN" 2 1)[:EXTERNAL]
Hopefully within a month or so (but no primises) I'll have time to finish
cleaning up the function names in backtraces, so that you won't see the
XEP, but just (ONE-ARG-FUN ...). In the meanwhile, don't be fooled by
the XEPs, VARAGRS-ENTRY-POINTS, etc in the backtraces, but actually read
what they say. ;-)
(And yes, the reversed arguments in the frame are a known debugger bug.)
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."