This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Better error messages...


One of the improvements I was planning on making with the big
software-engineering face-lift of a couple months ago was better error
reporting.  I finally put the last little piece in place to add a bunch
of value to a *lot* of error messages (but by no means does it cover all 
messages that could be improved).  Now, if you eval, e.g.:

(set-car! 1 'a)

Instead of just this message:


Backtrace:
0* [set-car! 1 a]

ERROR: In procedure set-car! in expression (set-car! 1 (quote a)):
ERROR: Wrong type argument in position 1: 1
ABORT: (wrong-type-arg)


You get information about what type was expected:


Backtrace:
0* [set-car! 1 a]

ERROR: In procedure set-car! in expression (set-car! 1 (quote a)):
ERROR: Wrong type argument in position 1 (expecting CONSP): 1
ABORT: (wrong-type-arg)
                                         ^^^^^^^^^^^^^^^^^

This was done with a very small change to the macro expansion of the
macro used to create the various SCM_VALIDATE macro definitions, so the
effects are (thankfully) fairly widespread.

Hopefully this will substantially help in debugging when Scheme code
goes awry.

Greg B.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]