Might it be possible to use a map instead? Maps are designed to look values
up by a key which may differ from the value, which seems to be your use
case here.

If you have

{1 {:id 1, :foo "bar"},
2 {:id 2, :foo "car"}}

You can just do

(disj my-map 2)

To convert the original set into a map, you could do something like:

(into {} (map (juxt :id identity) my-set))

Phil
On Mar 23, 2012 2:59 AM, "Leandro Oliveira" <lolive...@gmail.com> wrote:
>
> Hi all,
>
> I have a set of hash like this:
>
> #{{:id 1, :foo "bar"} {:id 2, :foo "car"}}
>
> and I'd like to remove an item based on its id value.
>
> Unfortunately, disj requires that I pass the whole map as key to remove
it.
>
> Can I remove the map from the set only using the id?
>
> My intention is to avoid a lookup on set to get the whole map back.
>
> Any suggestions?
>
>
> Thanks in advance.
> leandro.
>
> --
> 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 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

Reply via email to