On Sun, May 17, 2009 at 11:48 PM, Konrad Hinsen
<konrad.hin...@laposte.net> wrote:
>  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.

I disagree that incremental extension of a module is a "quick and
dirty" prototyping technique, and would argue that this is a
fundamentally desirable feature.

As an example, I authored clojure.contrib.math.  Someone came up with
a slightly faster algorithm for one of the functions (which is used in
turn by other functions in the library), but I can't include it unless
he signs a contributor agreement.  If he wants to create his own
version of the module for his own personal use, in which he swaps out
my function for his faster one, there appears to be no good way to do
this, short of copying my entire file, commenting out my function, and
replacing it with his.  Clearly this is not an acceptable solution,
because then he won't benefit from any future updates I make to the
module.  He can't use the "load" trick, all because of the (ns
clojure.contrib.math) declaration at the top of the file.

Based on this discussion, it sounds like I (and all library authors)
should have provided all of my math functions in one file (say,
math_functions.clj), and then had a separate file (math.clj)
containing:
(ns clojure.contrib.math
  (:load "math_functions"))

just to make it possible for users to get at my code in its
uncompiled, unlinked-to-clojure.contrib.math-namespace form for the
purposes of incremental extension.

If all library authors want to start doing this, I guess that's one
solution.  I'm just hoping there is a better way.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to