Re: "Binding" and temporary global state

2010-09-06 Thread Cameron Pulsford
, Jarkko Oranen wrote: > Cameron Pulsford wrote: > > Is there a way to do this? Besides cleaning up function signatures is > > this a premature optimization to begin with? > > > (declare *macros*) > > > (defn macro-expand [tokens] > >   (map #(get *macros* %

"Binding" and temporary global state

2010-09-06 Thread Cameron Pulsford
Hello all, here is an extremely reduced version of a problem I'm not sure how to work around. (It's going to be a toy assembly language if anyone's wondering) When I call assemble in the following code I get the error: "java.lang.IllegalStateException: Var reader/*macros* is unbound." I'd like *mac

Re: trouble using nested map fn

2010-08-23 Thread Cameron Pulsford
The difference is not HUGE, but in a critical section it might be a valid micro-optimization. I'd also be interested to know why, but I bet you're assumption of apply being thrown in the mix is probably pretty close to true. user=> (time (dotimes [_ 1e6] (doall (map #(filter even? %) (for [i (rang

Re: Unsigned-right-shift patch

2010-08-23 Thread Cameron Pulsford
Yes the 1.0 was a slip on my part, and I agree that I should have used the class/staticMembers syntax; at the time I was simply trying to fit in. Regardless, here is the updated patch with those two comments fixed: http://github.com/cpulsford/bitops/blob/logical-assumption/unsigned-right-shift.pat

Re: Idea for personal Clojure project

2010-07-28 Thread Cameron Pulsford
A very good place to start searching about edit distances between words and some related stuff can be found on Peter Norvigs site at: http://norvig.com/spell-correct.html Also, try to find some wikipedia articles about the bm25 ranking algorithm, I used clojure for an assignment at school that