On Sep 16, 4:10 pm, Nicolas Oury <nicolas.o...@gmail.com> wrote: > The logged function would have to be already a generic method, no?
Yes, and in idiomatic Common Lisp that's not particularly common (pardon the pun). Generic functions are typically only used when dynamic dispatch is actually needed. However, you can achieve what the OP asked by doing something like (untested): (let ((original-fn (symbol-function 'foo))) (setf (symbol-function 'foo) (lambda (&rest args) ...whatever... (apply original-fn args)))) which is similar to the alter-var-root solution proposed upthread. Note also that the OP's original example does not require anything more than what defmacro already provides. And turning function calls into macro calls is not a great idea; it won't cover the use of apply and similar. -- 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