user=> (defrecord Foo [a])user.Foouser=> (def a (Foo. 1))#'user/
auser=> (def b (Foo. 2))#'user/b
user=> (defrecord Other [b])
user.Other
user=> (def q (Other. 123))
#'user/q
user=> (def p (Other. 456))
#'user/puser=> (filter #(= (class %) user.Foo) (map var-get (vals (ns-
publics 'user))))
(#:user.Foo{:a 2} #:user.Foo{:a 1})

Cheers,
-M On Nov 5, 4:03 am, Colin Taylor <[email protected]> wrote:
> Hi,
>
> given a namespace sources
>
> with [simplified definitions]
>
> (defrecord Source [name url])
>
> (def google (source "Google" "google.com"))
> (def bbc (source "BBC" "bbc.co.uk"))
> (def nbc ...
> etc.
>
> what would be the idiomatic way to implement
>
> (defn get-all-sources)
>
> cheers
> Colin

-- 
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

Reply via email to