>
> I am not a Clojure expert. But if I understood Clojure correctly,
> Clojure would not be Clojure if it where natively compiled. Eg. The
> whole lazy seq's are required because of lack of tail call
> optimization in the JVM. Or am I wrong?
>
>
I don't think the lazy seq are necessary because of TCO. They are
useful for a lot of things.
They allow to write a nice abstract function, and have it executed in
an efficient manner.
(Without blowing memory, and, with chunky sequences, with good cache locality.)

They can help to prevent some stack overflow problems, but I am not
sure a lot of lazy function would be
TCoptimised. For example, the usual map is not tail recursive:
(defn my-map [f l]
  (when l
    (cons (f (first l)) (my-map f (next l)))

You can write a tail recursive version, but it would be equivalent to
accumulating with a loop and reversing the result.
Which you can do in Clojure.

Best regards,

Nicolas.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to