On Sat, Apr 17, 2010 at 2:29 AM, Kevin Livingston
<kevinlivingston.pub...@gmail.com> wrote:
> I have an application that will read in a large number of structures
> from a file.  those structures will be used throughout the application
> to produce additional data etc.  since they are "user" configurable,
> it would be nice to know where they come from should one of them start
> misbehaving.  the type of metadata the compiler associates with
> function definitions etc. would be very valuable.  if I'm reading my
> structures in with (read) is there anyway to get it to attach filename
> and line-number etc. metadata?

The reader doesn't do that but you can easily do it yourself if you
only want to annotate top-level values.

Thinking about this made me realize that it would be nice if the
reader reentered itself (as it does in LispReader's
readDelimitedList() and a few other contexts) through a var so it
could be rebound by a programmer. Then you could inject your own line
number annotation into the reader which would apply not only to
top-level values (e.g. a vector literal) but also its subvalues (e.g.
the elements of the vector literal).

-Per

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to