How to handle dependencies on multiple versions of the same library?

2012-05-02 Thread kurtharriger
OSGI is one way to solve this problem, but it is rarely worth the effort. It requires adding lots of meta data to every dependency which only a few major libraries actually provide. There are some tools to help with this process but they dont generally work with dynamic languages. Honestly, un

Re: LinkedHashMap not well supported

2012-04-30 Thread kurtharriger
Sounds good. Ill submit a patch for walk. Im not real sure why apply hash-map didnt work, but if figure it out Ill add that too. -- 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 p

Re: LinkedHashMap not well supported

2012-04-29 Thread kurtharriger
Ill agree that it may be approriate for map? to return false as it does perhaps imply a stricter contract then the jvm versions namely immutability. However, I fully expected the return type of keywordize to be a new immutable clojure map and it would be extreamly helpful if walk, hash-map, fir

Re: (update-in) and getting the new value at the leaf efficiently

2012-04-26 Thread kurtharriger
I think you are too concerned with micro optimizations. get-in is probably just as efficient as attempting to bubble the state change back up and certainly simpler to work with. In practice, optimizations like this do not have a significant impact on the overall performace. Measure before yo

Re: Newbie question about rebinding local variables

2012-04-20 Thread kurtharriger
On Apr 20, 9:43 am, Craig Ching wrote: > Thanks for your input, I appreciate it. > > On Friday, April 20, 2012 10:16:51 AM UTC-5, kurtharriger wrote: > > > And you just need to keep the resulting state, no need to reapply the > > moves. > > Your main method mi

Re: Newbie question about rebinding local variables

2012-04-20 Thread kurtharriger
And you just need to keep the resulting state, no need to reapply the moves. Your main method might use a reduce or loop recur. (loop [game (new-game)] (if-not (complete? game) (recur (make-random-move game))) -- You received this message because you are subscribed to the Google Groups

Re: Newbie question about rebinding local variables

2012-04-20 Thread kurtharriger
By creating new game objects rather than mutating existing ones you could do things you wouldnt otherwise be able to do. Perhaps you have different solver strategies that you want to apply in parallel. Provided you can give each solver its own copy this is trivial, but if your datastructures req

Leiningen plugin authors: compatibility with version 2

2012-04-17 Thread kurtharriger
I know one of my plugins lein-groovyc broke due to automatic expansion from relative to absolute paths in properties ending with paths. Not a big deal i figured i would just change the property name and document as breaking change. What might be useful is a standard way to better label what ve

Re: A pr-str alternative that quotes lists?

2012-04-16 Thread kurtharriger
On Apr 16, 11:07 am, Jay Fields wrote: > If you go down that path, I think vec > (http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/vec) > is worth looking at. > > I've always understood that vec turns lists into vectors, but leaves > vectors alone... which looks like what you

Re: A pr-str alternative that quotes lists?

2012-04-16 Thread kurtharriger
On Apr 16, 10:45 am, Stuart Sierra wrote: > As an alternative, you could quote the entire expression (you can quote > anything, not just lists) when copying data structures into a test. > > -S It never occurred to me to do that so I guess that works... As my alternative, I went off and wro

A pr-str alternative that quotes lists?

2012-04-16 Thread kurtharriger
Frequently when working in the repl I want to take a datastructure and copy it into a test, however if that datastructure contains lists or more often lazy-seqences these are printed within unquoted (), so when I copy the result into my test I need to replace these lists with vectors or quote them.

NodeJS REPL

2011-10-12 Thread kurtharriger
k. I also tried to compile an completely empty.cljs file to nodejs and run this into node but this isn't working for me either. Anyone know a bit more about the node compilation that could help me bootstrap the repl environment? My work in progress is here: https://github.com/kurtharrig

Re: overriding keyword behavior?

2011-03-10 Thread kurtharriger
That was basically my question, protocols are designed for this but ILookup isn't a protocol. Is it possible to make ILookup into a protocol? I haven't looked at the java code much at all, but I might take a stab at creating a patch it that seems possible. Converting java.util.Properties into a

overriding keyword behavior?

2011-03-07 Thread kurtharriger
I was curious if it was possible to extend keyword lookup behavior to additional types, such as java.util.Properties. Currently I just convert java.util.properties into a keyword map with something such as the following. (defn as-keyword-map [prop] (into {} (for [[k v] prop] [(keyword k) v])))