Uploaded image for project: 'Clojure'
  1. CLJ-932

contains? should throw exception on non-keyed collections

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: None
    • Fix versions: Release 1.5
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      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.

        Attachments

          Activity

            People

            • Assignee:
              stuart.sierra Stuart Sierra
              Reporter:
              stuart.sierra Stuart Sierra
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: