Add map-entry? predicate

Description

Due to changes in 1.8 with making vector implement IMapEntry for 2-element vectors, checking whether something is a map entry has become a bit trickier. This enhancement proposes a new function `map-entry?` to encapsulate that check and any future updates to it.

The check for map-entry? will return true if the instance implements java.util.Map$Entry and if it is also a vector, if it's size is exactly 2.

Patch: clj-1831.patch

Screened by Joe Smith.

Environment

None

Attachments

1

Activity

Alex Miller October 25, 2015 at 3:08 AM

Yep, will do.

Nicola Mometto October 24, 2015 at 11:23 PM

Nicola Mometto October 24, 2015 at 11:21 PM

Sorry about that then, I restored the ticket status

Ghadi Shayban October 24, 2015 at 9:39 PM

Nicola, Joe Smith is core team.

Nicola Mometto October 24, 2015 at 9:33 PM

Only members of the clojure core team are allowed to screen tickets

Completed

Details

Assignee

Reporter

Approval

Patch

Priority

Affects versions

Fix versions

Created October 20, 2015 at 2:21 AM
Updated October 27, 2015 at 7:06 PM
Resolved October 27, 2015 at 7:06 PM