I'm pretty sure my wish is a common one, but I could find an answer in a few
I'm missing the equivalent of __LINE__ (and __FILE__) in C.
Using Clisp 2.41 (on Debian/Sid) I would be happy to have a macro dbgformat
(dbgformat "here x=~a ~%" x)
occurring in source file foo.lisp at line 345 had the same effect as
(format *debug-io* "foo.lisp:345: here x=~a ~%" x)
I know I could redefine the standard reader, etc... but I expect that file
location info already exist.
Any clues or advices please? I could switch to another free lisp (eg SBCL)
if it would be easier.
Thanks in advance!
View this message in context: http://www.nabble.com/source-line-number-in-debug-message-tf3757069.html#a10618703
Sent from the clisp-list mailing list archive at Nabble.com.
From: Sam Steingold <sds@gn...> - 2007-05-15 15:06:11
-----BEGIN PGP SIGNED MESSAGE-----
Basile Starynkevitch wrote:
> I'm missing the equivalent of __LINE__ (and __FILE__) in C.
the short answer is that you are out of luck.
the longer answer is that Lisp offers better ways to do this (see
ASSERT, BREAK etc). you can also examine the stack when you get an error.
see also http://clisp.cons.org/impnotes/debugger.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----