Deprecating this(this)
Timon Gehr
timon.gehr at gmx.ch
Mon Apr 2 11:04:40 UTC 2018
On 02.04.2018 08:56, Shachar Shemesh wrote:
> On 01/04/18 03:32, H. S. Teoh wrote:
>> The one nagging question I've been having about pure is: how much are we
>> actually taking advantage of the guarantees provided by pure?
>
> My problem is that pure do not provide many guarantees.
> ...
It guarantees that no global state is accessed.
>> We have
>> developed very clever ways of extending the traditional definition of
>> pure and invented creative ways of making more things pure, which is all
>> great.
>
> Can anyone explain to me what good are the guarantees provided by a
> function that is pure but not strictly pure? I couldn't find them.
> ...
You can use weakly pure functions to compose strongly pure functions.
>> But AFAIK the only place where it's actually taken advantage of
>> is to elide some redundant function calls inside a single expression.
>
> You cannot even do that unless the function is strictly pure. For all
> D's extension of the pure concept, it weakened, rather than enhanced,
> what it means.
> ...
There is no such weakening.
>> And perhaps infer uniqueness in some cases for implicit casting to
>> immutable.
>
> Can you expand on that one?
>
> Shachar
More information about the Digitalmars-d
mailing list