Clojure

contains? should throw exception on non-keyed collections

Details

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

Description

The contains? function, given a collection which is not an associative (Map, Set, String, array), returns false instead of throwing an exception.

This is a subject of confusion when people call contains? on sequential collections like lists, and on associative collections which do not implement the Associative interface.

Other predicates, such as even?, throw an exception when passed arguments of an invalid type.

Activity

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: