On 29 Jul 2011, at 00:46, Kent wrote: > I'm not sure what you're trying to do with this and, based on that > ignorance, I'm not sure I think it's a great idea. Maybe you are being > a bit crazy, and maybe your a genius. Who am I to say? > > Here is a function that does what you want. The only difference is > that my function also takes the "binding-vec" function as an argument. > > > (defn mdbf [form binding-func] > (fn [& args] > (eval `(let ~(binding-func args) ~form)))) > > Here it is used in your example. > > (defn binding-vec > [args] > ['size (count args)] > > (def a (mdbf '(+ size 10) binding-vec)) > > (a 1 2 3 4) => 14
Very nice, thanks for this. However, using eval feels a bit too scary even for a crazy guy like myself! Perhaps I need to take a different angle to solving my problem… Sam --- http://sam.aaron.name -- 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