Comment

Comment by danneu

    ;; good
    (defn print-seq [s]
      (when (seq s)
        (prn (first s))
        (recur (rest s))))

    ;; bad
    (defn print-seq [s]
      (when-not (empty? s)
        (prn (first s))
        (recur (rest s))))
Why use `seq` instead of `not-empty`?

    (defn print-seq [s]
      (when (not-empty s)
        (prn (first s))
        (recur (rest s))))
parent danneu 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton