Can you elaborate more about how the system should behave? Also, I don't think it's correct to say that "you own the target function" here, since hook applies to the whole defmulti, not to some concrete defmethod, so I don't see any difference between hooks for functions and multimethods in this case.
суббота, 28 июля 2012 г., 9:37:57 UTC+6 пользователь George Oliver написал: > > > > On Friday, July 27, 2012 12:06:33 PM UTC-7, Vinzent wrote: >> >> robert-hooke actualy doesn't work with multimethods afaik. You can try my >> new library (https://github.com/dnaumov/hooks), but it's alpha (no docs >> yet, sorry). > > > Yes, from the robert-hooke readme, "Adding hooks to a defmulti is > discouraged as it will make it impossible to add further methods. Hooks are > meant to extend functions you don't control; if you own the target function > there are obviously better ways to change its behaviour.". > > What got me thinking about :before and :after was the question of how to > add a lightweight rules system to an application. Do you think hooks are > appropriate here? > -- 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