A maybe related newbie question. How common is it for Clojure to separate the two implementations into different libraries? For example, in an application I create one lib that contains just the data for the app (app.data) and two other libraries that provide the functions on the data (app.data.lazy and app.data.eager). The function names and signatures are same in both libs, but the implementations differ. By referring to the appropriate lib I decide what implementation to use.
Adam On Jul 16, 2009, at 10:47 PM, Eric Tschetter wrote: > > One other option is to use "binding" to overwrite the value in a > certain context. I.e. you have > > (defn do-something-elegantly ...) > (defn do-something-quickly ...) > > (def do-something do-something-elegantly) > > But, then you have some function that needs to be run quickly: > > (defn needs-to-be-fast [] (do-something ...)) > > For your call to needs-to-be-fast, you can just > > (binding [do-something do-something-quickly] (needs-to-be-fast)) > > and it will use the quickly version for that context and switch back > to the elegant version in other contexts. > > That said, you probably want to pass the function to the data like > John/Adrian mentioned > > --Eric Tschetter > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---