[Ecls-list] Get the line number where a condition occurs when load-ing a source Lisp file

Antonio Bonifati antonio.bonifati at gmail.com
Wed Jun 6 21:03:53 UTC 2012


Hi Lispers,
I am using ECL to implement a static site generator, something better than
Ruby's Jekyll, indeed I called it Hyde LOL I chose ECL because it is small,
fast and I want to generate Windows executables too.

I am a Lisp beginner that is learning a lot by doing this project that. My
problem is that I would like to provide the user with line number
information when my generator processes a user's Lisp file written by the
user that contains errors and thus signals a condition.

A Lisp addict told me that LispWorks has "source locators". Is there any
implementation-specific feature in ECL to get the line number where a
condition occurred, assuming that source comes from a file that is
(load)-ed?

My code is just doing a (load "userfile.lisp") inside a handler-case that
prints any condition that may happen. As I said I would like to complement
that error string with a line number so the user knows which line the error
is and can jump directly to it with his editor. User files are not
compiled, I load them as source code at runtime. This is perfectly
acceptable in this application because they need to be  run only once after
each modification in order to regenerate the static HTML code (e.g. I run
index.lisp to generate index.html). It isn't worth to compile something
that you only have to run one time :)

Grazie tante!
--
Antonio Bonifati
Student and Italian teacher
http://ninuzzo.github.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20120606/46b7ee71/attachment.html>


More information about the ecl-devel mailing list