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 <lprefonta...@softaddicts.ca>
wrote:

> 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 alist '(a1 a2))
> >
> > (filter #(= "test1" (:fname %)) alist)
> >
> > I expect the filter to match the a2 record, but I obviously do something
> > wrong and would appreciate any suggestion.
> >
> > Kind regards
> > Magnus Jäverberg
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> --
> Luc Préfontaine<lprefonta...@softaddicts.ca> sent by ibisMail!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to