Clojure

Change select-keys to return same type of map as it is given

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

select-keys always returns a map built up from {}. This will sometimes not be the same type of map as the one given as the first arg, e.g. if the first arg is a sorted-map, the returned map will not be. There are situations where it would be nice if it preserved the kind of map it was given, e.g. the developer wishes to preserve the sorting order of the keys.

Discussion thread on Clojure group: https://groups.google.com/forum/#!topic/clojure/l_V1N1nRF-c

  1. clj-1287-1.diff
    01/Nov/13 9:36 AM
    3 kB
    Andy Fingerhut
  2. clj-1287-3.diff
    14/Feb/14 12:11 PM
    3 kB
    Andy Fingerhut

Activity

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: