On 17.05.2009, at 21:24, Mark Engelberg wrote:

> For many years, my primary language for doing these sorts of programs
> has been Python.  In my first pass, I just have a bunch of functions
> in a file with global variables at the top.  For exploring simple
> changes, I can just import a file and then mutate the global
> parameters.  When things get too complex for that, I reorganize into
> objects, and express the variation through inheritance and overriding
> the things I want to change.

This approach doesn't work in Clojure because the global symbols are  
resolved at namespace evaluation time (compile time, more or less),  
not at run time as it does in Python. The conclusion is that  
namespaces are not the right level to do such modifications.

One rather straightforward solution is to work at the level of source  
code files. Your gravity_variation1.clj would read in the source code  
of gravity.clj and evaluate it together with its modifications.

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

Reply via email to