On 18.05.2009, at 08:05, Mark Engelberg wrote: > David, that seems to work. I think I can achieve my objectives with > this strategy.
David provided a much better implementation of the idea that I had for this. I hadn't thought of the "load" function. > However, I must admit, I find it rather unsettling that collections of > functions written inside of namespaces are fundamentally less > composable than those that are not. That's not how I would describe it. Every function (in the sense of a function object) is in some namespace. What you consider functions outside of a namespace are actually forms representing functions. The difference between importing a namespace and loading its source code file is analogous to the difference between using functions vs. macros. In fact, you could replace (load ...) by a macro that expands into the contents of the loaded file. It is well accepted in the Lisp world that some problems are best solved by macros, so this is just one more. > It means that to remain extensible, I need to write two files for > every group of functions -- > one to hold the actual functions, and one to load the first file > and wrap it inside of a namespace. In terms of modularity, that makes sense. You have a more symmetric situation: one file holds the common definitions, and any number of files import these and add to them. It's the approach of "cloning and mutating" something that smells of "quick and dirty", although I agree it is quite convenient in the prototyping phase. Konrad. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---