Hi, I wanted to serialise functions and send them over the network. The problem with serializable-fn is that it doesn't capture closures. I wrote some code which re-programmed the fn macro to capture the closures as well as the actual function form, and attach them as meta-data also on the actual function object. I could share this code if people would find this useful. Its non-trivial due to various complexities and bugs in Clojure.
Also it bothers me that (= (partial * 2) (partial * 2)) is false. Logically it shouldn't be right? If we captured the function forms, that would enable better equality for functions. On 29 Mar 2012, at 17:44, Phil Hagelberg wrote: > On Thu, Mar 29, 2012 at 9:29 AM, Petr Gladkikh <petrg...@gmail.com> wrote: >> I am pondering on the idea of having more (or even a lot) of metadata >> that could be useful for debugging and problem resolution. >> Since we can store anything in metadata, can we store not only source >> file path and line number but whole source code that is associated >> with piece of code? > > See https://github.com/technomancy/serializable-fn/ for a > proof-of-concept of this idea. > > It's always bothered be that defn puts metadata on the var and not on > the function itself. > > Anyway, supposedly Rich is in favour of having "dynamicity knobs" > according to his Conj 2011 keynote, and this sounds like just the kind > of thing that would fall under that. > > -Phil > > -- > 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 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