Lazy evaluation

Timon Gehr timon.gehr at gmx.ch
Wed Nov 23 11:13:39 PST 2011


On 11/23/2011 07:59 PM, Peter Alexander wrote:
> On 23/11/11 6:05 PM, Jonathan M Davis wrote:
>> On Wednesday, November 23, 2011 18:41:46 Timon Gehr wrote:
>>> On 11/23/2011 12:53 AM, Jonathan M Davis wrote:
>>>> This basic idea was discussed a couple of months back, and it was
>>>> determined that it was overly complicated for very little gain.
>>>
>>> I strongly disagree.
>>
>> Well, you're free to disagree, but that's essentially what the discussion
>> resulted. And glancing at the thread ( http://www.mail-
>> archive.com/digitalmars-d at puremagic.com/msg65324.html ), it looks like
>> you
>> posted a couple of times in it, so I'd expect you to be at least somewhat
>> aware of what was discussed in it. It's nice in theory, but there are
>> a number
>> of complications for what most people consider to be a minor gain. And
>> for the
>> folks who really don't like transitive const, it doesn't go anywhere
>> near far
>> enough, since they want full-on caching with const, not just lazy
>> evaluation,
>> which just isn't going to happen.
>>
>> - Jonathan M Dav
>
> Just to be clear, I don't think anyone has any problem with the
> transitivity of const, but rather the fact that D only offers bitwise
> const and not logical const, and also that D protocols enforce bitwise
> const when only logical const is needed.
>

Exactly. This is how pure functional programming looks like in D at the 
moment:
http://pastebin.com/C6vf9DQQ

I didn't spot any 'immutable' or 'const'.

> Bitwise const is needed for safe concurrency, but only logical const is
> needed for pure functional programming.

And lazy evaluation already suffices.


More information about the Digitalmars-d mailing list