This sounds like a great idea. I was working with some tests today and it 
would have been really useful to have some way to query the current 
function/execution context. Seems like passing that through all lets would 
go a long way, provided I'm reading this right.

On Friday, February 8, 2013 10:18:54 AM UTC-7, 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