Question about doseq

2012-10-30 Thread arekanderu
Hello all, I have the following code: (def my-hash {"1" {:a-key {:value "a value"} :another-key "another value" >> :a-third-key []} > > "2" {:a-key {:value "a value"} :another-key "another >> value" :a-third-key []}} > > In the following example i get the following result:

Re: Is game development Clojure(functional in general) friendly?

2012-10-30 Thread arekanderu
I also happened to read an interesting articlerecently about functional programming by John Carmack . On Tuesday, October 30, 2012 9:00:07 AM UTC+2, titon barua wrote: > > Hi, >

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
After adding the dependencies of noir to my own project.clj, everything worked fine :) I hope that noir developers will make it a bit easier soon... On Thursday, October 4, 2012 9:26:56 PM UTC+3, arekanderu wrote: > > OK, the problem is that the custom encoders isn't merged with

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
ober 4, 2012 8:54:17 PM UTC+3, arekanderu wrote: > > In fact, on the latest commit, > response.clj<https://github.com/bitwalker/noir/blob/master/src/noir/response.clj>does > not seem to use chesire.custom anymore even though this > commit<

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
herwise. On Thursday, October 4, 2012 8:32:25 PM UTC+3, arekanderu wrote: > > Hi Gaz > > That's exactly the part that I can't figure out. Where exactly am I > supposed to do that? Inside the clj where I am going to use noir.response? > My apologies if my question seems silly b

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
Gaz wrote: > > It seems to be using cheshire under the covers, did you add an encoder > for your class? e.g: > > (add-encoder java.awt.Color > (fn [c jsonGenerator] > (.writeString jsonGenerator (str c > > On Thu, Oct 4, 2012 at 12:04 PM, arekanderu >

Noir.response and custom java object

2012-10-04 Thread arekanderu
Hello, I am not sure if i am supposed to ask a noir-related question in the group but the noir issues at github is closed so i thought someone here might know. I am trying to use a custom encoder

Re: Clojure web framework

2012-10-03 Thread arekanderu
d out great for us. > > On Wed, Oct 3, 2012 at 1:01 PM, arekanderu > > wrote: > > Hello, > > > > I had a similar question as the OP so I thought i should post it in this > > thread instead of starting a new one. > > > > I am trying to build a w

Re: Clojure web framework

2012-10-03 Thread arekanderu
Hello, I had a similar question as the OP so I thought i should post it in this thread instead of starting a new one. I am trying to build a web services api which will only respond in json format. I had a look at everything suggested in this topic and I am leaning towards noir. Do you think t

Re: Transforming an ugly nested loop into clojure code

2012-10-02 Thread arekanderu
Thank you for your input Stathis, I will have a look at them as well. On Sunday, September 30, 2012 10:59:05 PM UTC+3, arekanderu wrote: > > Hello, > > I am trying to port an ugly piece of code from Ruby to clojure. So far I > have only ported it to clojure by keeping the same way

Re: Transforming an ugly nested loop into clojure code

2012-10-01 Thread arekanderu
; (if-not (empty? (:items box)) > (doseq [item (:items box)] (do-something (:box box) (:item item))) > (do-something-else (:warehouse warehouse) > (:container container) > (:box box) > > Might be more appropriate..

Re: Transforming an ugly nested loop into clojure code

2012-10-01 Thread arekanderu
(:boxes container))) > > (:containers warehouse))) > > (:warehouses area))) > >data)) > > My question is, how can I get rid of the nested loops and replace it with something more elegant in clojure. Thank you for any replies.

Re: Transforming an ugly nested loop into clojure code

2012-09-30 Thread arekanderu
nday, October 1, 2012 12:41:52 AM UTC+3, Grant Rettke wrote: > > On Sun, Sep 30, 2012 at 2:59 PM, arekanderu > > wrote: > > I am trying to port an ugly piece of code from Ruby to clojure. > > May you share the original code? > > > So far I > > hav

Transforming an ugly nested loop into clojure code

2012-09-30 Thread arekanderu
Hello, I am trying to port an ugly piece of code from Ruby to clojure. So far I have only ported it to clojure by keeping the same way it was written in Ruby and i am trying to re-write it the clojure way because...wellits very ugly. I have a complex hash map which it's structure is always

Re: Questions regarding do form

2012-09-27 Thread arekanderu
Thank you Meikel for your so helpful replies. On Thursday, September 27, 2012 4:19:44 PM UTC+3, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > Am Donnerstag, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu: > > I am new to clojure and I have two questions about do and the

Questions regarding do form

2012-09-27 Thread arekanderu
Hello all, I am new to clojure and I have two questions about do and the way it should be used. *Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same result.* (defn my-fn [java-object] (. java-object firstFunc) (. java-object secondFu