On 21 October 2014 12:52, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:
> > Okay. I can give you a very concrete example, and one where I think that > it probably has been actually useful to you. > > Imagine you write the following piece of code: > > (first l) > > This returns a value. If we obeyed the universal access principle, > however, we would not know whether this resulted from computational or > otherwise. And, in fact, Clojure does exactly this. So you're saying laziness and UAP are the same thing in your view? I'm not sure I'd necessarily consider deferring computation to be the same as uniform access. Deferring computation can occur once, so you couldn't, for instance, use it to solve the :doc problem you mentioned earlier, where the :doc string of a var would depend on the contents of the var. That said, I think you could reasonably argue that that "immutable UAP = laziness". However, even with this restriction, lazy data structures are still more complex than strict structures. They may pull in side effects and are not confined in size. But they are, as you point out, extremely useful, which is why I like Clojure's compromise of having lazy seqs and strict everything else. To be clear, I don't think Clojure is necessarily against complexity, just against unnecessary complexity. "The simplest thing possible, but no simpler." The distinction of Clojure is not that it prefers data over APIs, but > that it prefers relatively few APIs, reused where possible. I don't think those are mutually exclusive ideas; I think they both stem from the premise of reducing coupling, or in Clojure terminology, "complexity". Clojure prefers both idea because data is simpler than APIs, and fewer APIs are simpler than more APIs. - 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.