Re: Returning multiple values

2016-11-30 Thread Colin Yates
I bet you it doesn't :-). It may be rendered like that but I doubt very much the server is returning the form ({..} {..} {..}) as that is interpreted as a function call. It will almost certainly be returning a sequence of the form '({..} {..} {..}) which isn't a functional call but is a sequence

Re: Returning multiple values

2016-11-30 Thread 'Rickesh Bedia' via Clojure
Because the information is coming from a table I don't know if I can change it to look like that. The information from the table looks like {:people ({:name "John" :age 25} {:name "Harry" :age 23} {:name "Peter" :age 24})} I was wondering if you could apply (into [] (map (-> class1 :people)

Re: Returning multiple values

2016-11-30 Thread Colin Yates
(def class1 {:people '({:name "John" :age "25"} {:name "Harry" :age "23"} {:name "Peter" :age "24"})}) or (def class1 {:people [{:name "John" :age "25"} {:name "Harry" :age "23"} {:name "Peter" :age "24"}]}) is probably what you want. (mapv (juxt :name :age) (:people class1)) on either of those

Re: Returning multiple values

2016-11-30 Thread Colin Yates
Ah, I just realised people is _not_ a sequence of maps but the result of calling '{:name "John" :age "25"}' passing in the other two maps as arguments. You probably want a literal literal '({:name "John" :age "25"}.) or a vector [{:name "John" :age "25"}...] On 30 November 2016 at 10:29,

Re: Returning multiple values

2016-11-30 Thread Colin Yates
(mapv (juxt :name :age) (:people class1)) should work On 30 November 2016 at 10:27, 'Rickesh Bedia' via Clojure wrote: > I have a definition: > (def class1 {:people ({:name "John" :age "25"} > {:name "Harry" :age "23"} >

Returning multiple values

2016-11-30 Thread 'Rickesh Bedia' via Clojure
I have a definition: (def class1 {:people ({:name "John" :age "25"} {:name "Harry" :age "23"} {:name "Peter" :age "24"})}) The result I want is a vector that looks like [["John" "25"] ["Harry" "23"] ["Peter" "24"]] If I call