James Reeves <ja...@booleanknot.com> writes:

> 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 am saying that UAP enables you to implement laziness freely.


> 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.

No, for that you computational in general. Deferred computation would be
enough to support, for example, thalia's extended documentation,
although you'd have to decide up front.

Regardless, we have a nice example in Clojure, where we not
distinguishing between data and computation allows us to do something
nice.

Another example is memoize, which does the opposite -- it makes data
appear to be computation, and means that you can, for example, use a
intuitive recursive definition of fibonacci, without exploding the
compute time.


> To be clear, I don't think Clojure is necessarily against complexity, just
> against unnecessary complexity. "The simplest thing possible, but no
> simpler."

Unfortunately, this distinction is one made at an application level, I
think, and not at a code level.

All of this discussion has made me think I should revist the issue. I
could put my own Map implementation on my vars as metadata, and have
this map work lazily, so that the calculation of the :doc metadata
happens through computation.

That would be evil.

Phil

-- 
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