应该在里面(lazy-seq ...)
(def lseq-in (lazy-seq (cons 1 (more-one))))
还是出去?
(def lseq-out (cons 1 (lazy-seq (more-one))))
我注意到
(realized? lseq-in)
;;; ⇒ false
(realized? lseq-out)
;;; ⇒ <err>
;;; ClassCastException clojure.lang.Cons cannot be cast to clojure.lang.IPending clojure.core/realized? (core.clj:6773)
clojuredocs.org上的所有示例都使用“out”。
涉及哪些权衡?