I have been developing with Common Lisp for almost a year now and it is really starting to get nervous. I started programming CL using CLISP, but later switched to SBCL for speed. I do a lot of pretty low-level things, so I need to interact with a lot of C code. I really like the incremental aspect of CL development (I don't use Emacs, however - I run SLIMV in Vim), but I'm in development slower than in Python , Perl, C, or even NASM. The root of the problem is the SBCL error messages. Once I had to look for almost 500 lines of code because SBCL decided to give me ERROR: Invalid number of arguments on foreign function #< some memory address > . It was not indicated which function was called, line number, nothing. More recently, I was pleased to receive The loaded code expects an incompatible layout for class SB-PRETTY:PRETTY-STREAM. randomly. The code runs FINE on CLISP, but just fails with obscure errors on SBCL. Is there a way to make these messages somewhat more informative? I have been writing C and assembly for almost 6 years now, and even they will give you the line number. The only valid SBCL errors that I saw were reader errors, which are almost useless as they usually make up the missing bracket. Again, is there an ad / command line switch that you can use to change it? I would not be mistaken writing my own error printer at this point.
EDIT: For example, with (sb-ext:restrict-compiler-policy 'debug 3) in my ~ / .sbclrc (using --load, not a script, so the .sbclrc file is loaded)
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread #<THREAD "main thread" RUNNING {AB09931}>: invalid number of arguments: 0 Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (SB-KERNEL::INVALID-ARG-COUNT-ERROR-HANDLER #<unavailable argument> #.(SB-SYS:INT-SAP #XB78CDAE0) #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #XB78CD7DC :TYPE (* (STRUCT SB-VM::OS-CONTEXT-T-STRUCT))> (79)) 0] print (SB-KERNEL::INVALID-ARG-COUNT-ERROR-HANDLER #<unavailable argument> #.(SB-SYS:INT-SAP #XB78CDAE0) #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #XB78CD7DC :TYPE (* (STRUCT SB-VM::OS-CONTEXT-T-STRUCT))> (79)) 0] down (SB-KERNEL:INTERNAL-ERROR #.(SB-SYS:INT-SAP #XB78CD7DC) #<unavailable argument>) 1] down ("foreign function: #x805FCBB") 2] down Bottom of stack.
Not entirely informative.
Samuel breese
source share