On May 16, 10:45 pm, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> So I've built a file/namespace with several functions.  There are
> several globals defined at the top of the file (for example,
> *gravity*) which many of the functions refer to.  I made them globals
> precisely because it would have been a pain to thread them through
> every single function that uses them.
>
> Now, I need to maintain two versions of this module.  For example,
> let's say I want one module where the *gravity* constant is defined to
> be 1.0, and one where it is defined as 2.0.
>

Could be more specific about what it means to "maintain two versions
of this module". With the same name? Or, you want a namespace to
behave like an object?

> I know how to do this in other languages, especially OO ones, but I'm
> scratching my head trying to think of a clean solution in Clojure for
> this seemingly simple problem.  I've tried various namespace trickery
> with vars and bindings, but I haven't found a workable solution yet.
> What am I missing?  Thanks.

Could you give an example of how you would do this in Java?

Thanks,

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