The logged function would have to be already a generic method, no? On Wed, Sep 15, 2010 at 7:50 PM, Matt Fowles <matt.fow...@gmail.com> wrote: > All~ > My clojure is fairly weak, but the particular example given would be > accomplished in common lisp using generic methods and the > :around modifier... > http://www.aiai.ed.ac.uk/~jeff/clos-guide.html > Matt > > On Wed, Sep 15, 2010 at 2:26 PM, Alan <a...@malloys.org> wrote: >> >> My guess is no. It would remove a huge benefit of Clojure, which is >> that you can tell, without having to look over the whole codebase, >> exactly what a given form does. (my-thing 20 [x y]) invokes my-thing, >> a function or macro, with 20 as its first argument, and then a vector >> of locals. No need to hunt down x and y, they're in the lexical scope; >> no need to guess at the syntax for my-thing. If you can have magical >> functions that transparently adjust forms all over the codebase, it >> becomes extremely difficult to be sure of what some code is doing, >> even without "abuse". >> >> Also, metamacros would be very hard to write *right*. Two of them >> might compete over a chunk of code, accidentally falling into infinite >> co-recursion. Layering them would be very tricky, too: do you apply >> them before or after regular macros? If you try to do both you may end >> up compiling forever, alternating between different types of macro >> expansions. But suppose you want to write your logging function to >> modify all function definitions, and someone has written this code: >> (def call-listish (fn [fn elem] (fn [elem] 10))) >> >> How on earth will you know that the first instance of (fn [x] y) is a >> function declaration, and the second isn't? >> >> On Sep 15, 11:03 am, Luke VanderHart <luke.vanderh...@gmail.com> >> wrote: >> > Any thoughts? I grant you, the potential for abuse is huge. Would the >> > benefits outweigh it? >> > >> > Thanks, >> > -Luke V. >> >> -- >> 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
-- Sent from an IBM Model M, 15 August 1989. -- 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