I see—that explains a lot.
On Feb 21, 5:01 pm, Rich Hickey <richhic...@gmail.com> wrote:
> On Feb 21, 5:58 pm, samppi <rbysam...@gmail.com> wrote:
>
> > Allowing dissoc and select-keys to accept both keys as arguments and
> > as a collection would be nice, and backwards compatible.
>
> Nope - Collections can be keys.
>
> > In any case,
> > ostensibly it should be consistent; otherwise, it's just an
> > idiosyncrasy in the language that people will have to deal with. I
> > wonder what the reasoning is behind it, or if it was completely
> > arbitrary.
>
> In an application that uses select-keys heavily, it will be common to
> have keysets as their own entities.
>
> That's not the case for dissoc.
>
> Rich
>
> > On Feb 21, 1:28 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
>
> > > (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 clojure@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---