Clojure

Correct placement of doc string for function bubble-max-key

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code

Description

It is private, defined with defn-, so perhaps the doc string is superfluous, but someone wrote one, and it is in the wrong place relative to the args:

(defn- bubble-max-key [k coll]
  "Move a maximal element of coll according to fn k (which returns a number) 
   to the front of coll."
  (let [max (apply max-key k coll)]
    (cons max (remove #(identical? max %) coll))))

Found using a pre-release version of the Eastwood Clojure lint tool.

Activity

Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-1314-v1.diff [ 12550 ]
Andy Fingerhut made changes -
Attachment clj-1314-v2.diff [ 12583 ]
Andy Fingerhut made changes -
Attachment clj-1314-v1.diff [ 12550 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Alex Miller made changes -
Labels docstring

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: