auxiliary methods like :before and :after for multimethods?

2012-07-26 Thread George Oliver
hi, I'm wondering if anyone has extended multimethods with auxiliary methods like CL-style :before and :after, and if not what a suitable substitute might be. thanks, George -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: auxiliary methods like :before and :after for multimethods?

2012-07-26 Thread Kevin Downey
https://github.com/technomancy/robert-hooke/ On Thu, Jul 26, 2012 at 2:15 PM, George Oliver wrote: > hi, I'm wondering if anyone has extended multimethods with auxiliary methods > like CL-style :before and :after, and if not what a suitable substitute > might be. > > > thanks, George > > -- > You

Re: auxiliary methods like :before and :after for multimethods?

2012-07-27 Thread Vinzent
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). Any suggestions about API is welcome. пятница, 27 июля 2012 г., 3:15:44 UTC+6 пользователь George Oliver написал: > > hi, I'm wondering

Re: auxiliary methods like :before and :after for multimethods?

2012-07-27 Thread 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

Re: auxiliary methods like :before and :after for multimethods?

2012-07-28 Thread Vinzent
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 thi

Re: auxiliary methods like :before and :after for multimethods?

2012-07-28 Thread Ben Smith-Mannschott
On Fri, Jul 27, 2012 at 9:06 PM, 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). (defmulti foo* (fn [args] ...) ...) (defmethod foo* :x [args]...) (defmethod foo* :y

Re: auxiliary methods like :before and :after for multimethods?

2012-07-28 Thread Chas Emerick
On Jul 28, 2012, at 7:02 AM, Ben Smith-Mannschott wrote: > On Fri, Jul 27, 2012 at 9:06 PM, 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). > > (defmulti foo* (f

Re: auxiliary methods like :before and :after for multimethods?

2012-07-28 Thread Vinzent
> robert.hooke works fine with multimethods: > > user=> (defmulti foo class) > nil > user=> (defmethod foo :default [x] (str x)) > # > user=> (require '[robert.hooke :refer (add-hook)]) > nil > user=> (add-hook #'foo (fn [f & [x]] (str "K: " (f x > (#) > user=> (foo 42) > "K: 42" >

Re: auxiliary methods like :before and :after for multimethods?

2012-07-28 Thread Chas Emerick
On Jul 28, 2012, at 4:36 PM, Vinzent wrote: > > robert.hooke works fine with multimethods: > > user=> (defmulti foo class) > nil > user=> (defmethod foo :default [x] (str x)) > # > user=> (require '[robert.hooke :refer (add-hook)]) > nil > user=> (add-hook #'foo (fn [f & [x]] (str "K: " (