I would find this very useful in several projects I'm working on, where the 
library would be able to give better information on where the error is in 
the user's code if this metadata was available.

On Friday, February 8, 2013 12:18:54 PM UTC-5, vemv wrote:
>
> Given that: a) fns can have names for debugging purposes, and b) data 
> structures can have metadata, wouldn't it be a good idea to let let auto 
> attach (where possible) the names of the bindings to their corresponding 
> values?
>
> For example, the improved let I'm thinking of would translate this input:
>
> (ns my.namespace)
>
> (defn do-it
>   (let [foo (fn [] (throw (Exception.)))
>         bar {:hello (/ 0 0)}]))
>
> to:
>
> (ns my.namespace)
>
> (defn do-it
>   (let [foo (fn foo [] (throw (Exception.)))
>         bar ^{:origin :my.namespace/do-it$let$bar} {:hello (/ 0 0)}]))
>
> This could be used to increase the precision of the stack traces, or in 
> IDEs/editors for locating the exact source of an exception.
>
> Do you see such a mechanism being incorporated to clojure.core/let - 
> should I open a ticket?
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to