On 22 October 2014 10:01, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:

> James Reeves <ja...@booleanknot.com> writes:
> >
> >> Regardless, we have a nice example in Clojure, where we not
> >> distinguishing between data and computation allows us to do something
> >> nice.
> >
> > Yes... I agree it allows us to do something, but let's agree to disagree
> on
> > whether that something is "nice" :)
>
> Laziness? In my experience it is not nearly as useful as it is suggested
> to be, but it does seem to be pushed as a feature of clojure.


No, I mean unrestricted uniform access.

Clojure's laziness is restricted to seqs and is guaranteed to always
produce the same value for the same field. That limits its complexity.

That said, seqs still have their issues, even with their inherent
restrictions. For instance, it's easy to accidentally hold onto the head of
a seq, particularly if it's passed in as an argument to a function. For
example:

    (defn print-seq [xs]
      (doseq [x xs]
        (println x)))

In this case the behaviour of the seq complects with the outer lexical
scope, causing an unintended side effect.

Lazy seqs are certainly useful, but I also wonder if we're going to see
them being used less in future, in favour of solutions built around
CollReduce. Is it possible to do without them entirely? I'm not sure, but
it would be interesting to find out.

- James

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to