Clojure

distinct? does not accept zero arguments

Details

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

Description

distinct? cannot be invoked with zero arguments. When using the pattern (apply distinct? x), this is bothersome as you have to check whether x is empty or not. It is also logical that distinct? should return true if no arguments are given, since there are no duplicates.

What (small set of) steps will reproduce the problem?

user=> (apply distinct? [])
ArityException Wrong number of args (0) passed to: core$distinct-QMARK-  clojure.lang.AFn.throwArity (AFn.java:437)

What is the expected output? What do you see instead?

I would expect distinct? to return true whenever given zero arguments.

What version are you using?

This was tested under Clojure 1.4 and Clojure 1.5.

Activity

Hide
Jean Niklas L'orange added a comment -

Attached the straightforward patch which solves this issue.

Show
Jean Niklas L'orange added a comment - Attached the straightforward patch which solves this issue.
Jean Niklas L'orange made changes -
Field Original Value New Value
Attachment clj-1179-distinct-zero-arguments.txt [ 11902 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Stuart Halloway made changes -
Approval Triaged [ 10120 ]
Rich Hickey made changes -
Issue Type Defect [ 1 ] Enhancement [ 4 ]
Rich Hickey made changes -
Approval Triaged [ 10120 ] Not Approved [ 10008 ]
Rich Hickey made changes -
Resolution Declined [ 2 ]
Status Open [ 1 ] Closed [ 6 ]
Hide
Devin Walters added a comment -

Is there a reason this was closed without a comment?

Show
Devin Walters added a comment - Is there a reason this was closed without a comment?
Hide
Alex Miller added a comment -

Rich declined it, implying that it was not a change he wanted. Not sure of the reason.

Show
Alex Miller added a comment - Rich declined it, implying that it was not a change he wanted. Not sure of the reason.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: