printf( "%s %d\n", __FILENAME__, __LINE__ );
printf( "%s %d\n", __FILENAME__, __LINE__ );
which would result in:
foo.cpp 123
foo.cpp 124
Is there something like those macros in any LISP implementations? I
find em quite useful for quick debugging/tracing. Or..should I adopt a
better way of debugging my code? :P
Thanks
Have a look at:
*load-pathname*
*load-truename*
*load-verbose*
*load-print*
The notions of "source file name" or "source line number" don't mean
much in such a dynamic and retrospective language. Most of the code
in real applications doesn't come source files anyways but is
generated or compiled from higer level domain specific languages,
either at compilation time or at run time...
--
__Pascal Bourguignon__ http://www.informatimago.com/
Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.
> The notions of "source file name" or "source line number" don't mean
> much in such a dynamic and retrospective language. Most of the code
> in real applications doesn't come source files anyways but is
> generated or compiled from higer level domain specific languages,
> either at compilation time or at run time...
Source locations should refer to those higer level DSLs. I bet in most
cases there is a primary source written by a human, no matter in what
language, and error messages (both compile time and runtime) should
refer to that.
I don't know how to implement it when the transformation is done by
Lisp macros.
--
__("< Marcin Kowalczyk
\__/ qrc...@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/