(def popsicle-map {:red :cherry, :green :apple, :purple :grape})
; Note how the keys passed to dissoc are individual arguments.
(dissoc popsicle-map :green :blue) ; -> {:red :cherry, :purple :grape}
; Note how the keys passed to select-keys are in a vector, not
individual arguments.
(select-keys popsicle-map [:red :green :blue]) ; -> {:green :apple,
:red :cherry}
I wonder why these were implemented differently. Maybe both dissoc and
select-keys should accept both individual key arguments and a sequence
of keys.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---