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
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)
(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
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,
(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"}
>
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