; I have these records defined
(defrecord Customer [firstName lastName emailAddress deliveryAddress
invoiceAddress])
(defrecord Address [street number town postcode])
; I have this small sample data
(def customers
{
(->Customer "Drongo" "Bongo" "[email protected]"
(->Address "Gongo" "32A" "Fongo" 8888)
(->Address "Gongo" "32B" "Fongo" 1111))
(->Customer "Tinga" "Zinga" "[email protected]"
(->Address "Thinga" "767" "Dongo" 2222)
(->Address "Jinga" "828" "Qongo" 3333))
}
)
; and I want a small filter on an embedded property (deliveryAddress.number)
; this compiles but of course it's wrong so gives back an empty list
(prn (filter #(= "32A" (:deliveryAddress :number %)) customers))
I have tried putting -> and [] in various places and of course checked docs
In the end I thought it would be quicker just to ask here.
Thanks
Ray
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en