Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>>It may be that bad comments tend to be concentrated on particular threads, and that the right way to implement pending comments is per-thread rather than site-wide.

So what about this? Here comments is a vector of all the scores of comments inside one particular thread.

----

(defn filter? [comments threshold]

  (let [size (count comments)]

    (if (< threshold (/ (reduce + comments) size)) false

       true)))
;;user=> (filter? [1 2 3 4] 2)

;;false

;;user=> (filter? [1 2 3 4] 3)

;;true



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: