Hi,

Am 14.12.2009 um 01:07 schrieb Mark Triggs:

>  (defn line-seq
>    "Returns the lines of text from rdr as a lazy sequence of strings.
>    rdr must implement java.io.BufferedReader."
>    [#^java.io.BufferedReader rdr]
>    (let [line  (. rdr (readLine))]
>      (when line
>        (lazy-seq (cons line (line-seq rdr))))))

Huh? Is there a reason, why it doesn't look like this:

(defn line-seq
  "Returns the lines of text from rdr as a lazy sequence of strings.
  rdr must implement java.io.BufferedReader."
  [#^java.io.BufferedReader rdr]
  (lazy-seq
    (when-let [line (.readLine rdr)]
      (cons line (line-seq rdr)))))

Is there some benefit treating a line-seq different to any other seq?

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to