I agree with Engelberg, except that records need to be treated specially.
Select-keys (and empty) on a record preserving the type but omitting one of
the record's predefined keys would make no sense, so I'd argue that records
have to give rise to normal (unsorted) maps when these are used on them.
So, sortedness and unsortedness (and any particular sort-key or sort-fn)
would be preserved by these operations, but not exact type.

Besides, exact type isn't preserved by even conjing in the case of
PersistentArrayMap/PersistentHashMap.


On Fri, Nov 1, 2013 at 3:18 PM, Mark Engelberg <mark.engelb...@gmail.com>wrote:

> On Fri, Nov 1, 2013 at 11:20 AM, Alex Miller <a...@puredanger.com> wrote:
>
>> I'm not sure I agree with the intent of the patch (as I can certainly
>> imagine times when I'd want a pure map from select-keys, not one that has
>> the characteristics of the source map).
>>
>
> I'm sure it's possible to imagine both needs, but if you have have a
> sorted-map, and you do a select-keys, don't you think the "principle of
> least surprise" is for it to stay a sorted-map?  I think intuitively,
> select-keys is about *restricting* the existing map in some way -- you
> expect things like the metadata and the type of the map to stay the same.
> Similarly, my intuition tells me that if you want a new kind of map, you'd
> have to "pour" the contents of the map into the other type of map via into.
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to