Re: loop/recur stack overflow

2010-08-28 Thread Michael Wood
Hi On 28 August 2010 02:25, neveu wrote: > I implemented the "Flavius Josephus" algorithm from Programming Praxis > in Clojure using loop/recur. My first version looked like this: > > (defn rotate-left >  ([ln n m] >     (take n (drop (dec m) (cycle ln >  ([ln m] (rotate-left ln (count ln) m)

loop/recur stack overflow

2010-08-28 Thread neveu
I implemented the "Flavius Josephus" algorithm from Programming Praxis in Clojure using loop/recur. My first version looked like this: (defn rotate-left ([ln n m] (take n (drop (dec m) (cycle ln ([ln m] (rotate-left ln (count ln) m))) (defn josephus3 [N M] ;; execute every mth soldie