by nodesocket · 12y ago · 0 comments
if post.created > 10 hours {
comments.pending(false);
}
Threads that are older should be allowed to be commented on by anybody.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
This could/should probably be a/b tested (eg: on/off on odd/even numbered submissions or whatnot).