I've written an implementation of this here: https://gist.github.com/dgrnbrg/4751473
It does incur a 2 instance check penalty (the branches should be 100% predictable, and never hurt in practice). I'm not sure if I could use protocols to further reduce the cost of the check. I've already put this into the util.clj in my project that needs this most, to good effect. David 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.