On Sun, 05 Apr 2015, Michael Blume wrote:
> your list doesn't contain the records, your list contains the symbols 'a1
> and 'a2. You can't make a list the way you're trying to.
To be specific, you're quoting the list in your def, so the a1 and a2 symbols
are
not evaluated.
user=> (defrecord A
your list doesn't contain the records, your list contains the symbols 'a1
and 'a2. You can't make a list the way you're trying to.
On Sat, Apr 4, 2015 at 5:14 PM Luc Préfontaine
wrote:
> You mean the a1 record no ?
>
>
> > Hi!
> >
> > I'm new to clojure, and have problem understanding how to fil
You mean the a1 record no ?
> Hi!
>
> I'm new to clojure, and have problem understanding how to filter a list of
> defrecords.
> I have tried different variations on the following:
>
> (defrecord Ape [fname lname])
> (def a1 (->Ape "test1" "test2"))
> (def a2 (->Ape "test3" "test4"))
> (def a
Hi!
I'm new to clojure, and have problem understanding how to filter a list of
defrecords.
I have tried different variations on the following:
(defrecord Ape [fname lname])
(def a1 (->Ape "test1" "test2"))
(def a2 (->Ape "test3" "test4"))
(def alist '(a1 a2))
(filter #(= "test1" (:fname %)) al