To help LDC/GDC

Dicebot m.strashun at gmail.com
Wed Apr 10 04:29:41 PDT 2013


On Wednesday, 10 April 2013 at 11:22:41 UTC, deadalnix wrote:
> On Wednesday, 10 April 2013 at 08:19:26 UTC, Dicebot wrote:
>> On Wednesday, 10 April 2013 at 01:37:35 UTC, deadalnix wrote:
>>>> Agree on it being great and innovative. But I fail to see 
>>>> usefulness with current design. Can you provide examples how 
>>>> current pure design allows for better code / optimizations?
>>>
>>> Strongly pure functions can call weakly pure function while 
>>> keeping its properties.
>>>
>>> So it loosen the constraint on strongly pure function while 
>>> keeping the benefit.
>>
>> It does not answer my question. Why "pure" keyword is useful 
>> in D if it does not guarantee that compiler will verify 
>> functional purity of you code and does not guarantee relevant 
>> optimizations?
>>
>> Beauty of concept is useless without practical application.
>
> It isn't beauty of concept. Strongly pure function exhibit from 
> an external point of view the properties of pure as in 
> functional programming.

Except you can't be sure that your function is strongly pure with 
current design. Add ref parameter into the mix by accident and it 
will silently change to weak pure which is useless by its own.


More information about the Digitalmars-d mailing list