Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Udayakumar Rayala
Then probably (apply concat) is better than (mapcat identity) isnt it? What is (cons ::sentinel)? Why do you need it here? On Wed, Feb 18, 2015 at 5:58 AM, Fluid Dynamics wrote: > On Tuesday, February 17, 2015 at 6:47:59 PM UTC-5, Ben wrote: >> >> why not (mapcat next)? >> > > Yeah, that should

Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Udayakumar Rayala
Ah ok. Got it. On Wed, Feb 18, 2015 at 9:13 AM, Fluid Dynamics wrote: > On Tuesday, February 17, 2015 at 10:24:29 PM UTC-5, Udayakumar Rayala > wrote: >> >> Then probably (apply concat) is better than (mapcat identity) isnt it? >> >> What is (cons ::sent

Re: Lucky numbers

2015-02-17 Thread Udayakumar Rayala
Do you want the check if your initial code is working correctly? Because when I ran it, this is the output with 100 numbers: (1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79 87 93 99) I have modified it like this. I have highlighted what I have changed.: (defn indexed-sieve [index this-l

defn inside defn

2014-11-15 Thread Udayakumar Rayala
Hi, Is it idiomatic to have defn inside defn? eastwood throws def-in-def warning when I have the following code: (defn double-square [y] (defn square [x] (* x x)) (+ (square y) (square y))) The above code is a simplified example to show the problem. In the above case, square

Re: core.async go-loop questions

2014-12-20 Thread Udayakumar Rayala
You could probably move setting the atom and calling my-wait-loop inside the try. (defn test-mailer [] (async/thread (try (do (reset! mailer-status (mailer/send-speaker-confirmation-notification 1 " http://localhost";)) (my-wait-loop)) (catch Excep

core async and transducers in Clojure 1.6.0

2014-12-29 Thread Udayakumar Rayala
Hi, We are currently using clojure 1.6.0 and using async channels version "0.1.346.0-17112a-alpha". I see that the (chan) function accepts a transducers but transducers are not available in Clojure 1.6.0. Is there any option other than upgrading to Clojure 1.7.0-alpha4? If not, how safe it i

Re: Please critique my code (barber problem with core.async)

2015-01-04 Thread Udayakumar Rayala
Your code is simple and easy to understand but it would look to see if atoms can be removed. Also the use go/while loop makes your code not stop and hence atom like @running is required. This is my attempt to solve the problem. I started with your code as the base and refactored it. Following are

Re: TDD and lein

2015-01-08 Thread Udayakumar Rayala
Not sure if you are doing this, you can run the tests in cider itself. This is much quicker than running "lein test" outside particularly when you are doing TDD. I use clojure.test so every deftest method is a function which you can run to see if the test passes or fails. Or you can run run-tests