Thanks for the tip, I meant something else. Let's say that I want to write a function do-something. There could be 2 implementations: do-something-quickly and do-something-elegantly. The parameters are the same and there are no differences in their "interface". I would like to be able to call it by writing (do- something arg) in my code and specify which implementation I want to use somewhere else (in the configuration part of the code).
On Jul 16, 4:28 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote: > Certainly multimethods : > * introduction :http://clojure.org/runtime_polymorphism > * detail :http://clojure.org/multimethods > > And, also, don't forget the power given to you by first class / higher order > functions. With them, a lot of "variability" can be placed just in > functions, where it was a pain in the ass to do correctly in java (you have > to first create an interface with a method, then derive the interface). And > often this was not done at all, and you ended up with a lot of similar > functions when their size was too small, etc. > > HTH, > > -- > Laurent > > 2009/7/16 Dragan <draga...@gmail.com> > > > > > Hi, > > > This is another one of my newbie questions, so please be patient if > > this is something out of the FP paradigm. > > I've noticed that there is a number of "duplicate" functions, > > functions that implement the same thing in a different way. In OO > > systems, I would use an interface to achieve the indirection. > > What should I use in Cilojure? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---