Proposal: Relax rules for 'pure'

Tomek Sowiński just at ask.me
Thu Sep 23 16:45:39 PDT 2010


Tomek Sowiński napisał:

>> Note that this is possible only because immutable and const are
>> transitive. It wouldn't be possible with head-const, or logical const.
> 
> But it would be possible with tail const. Quite a few functions could be
> made immutably pure if it meant tail immutability of their parameters. One
> example are manipulations of ranges on immutable structures.

I take that back. Guarantees on parameters still hold with tail const but it's not a big win in 
context of purity. It is a huge win elsewhere, though.

-- 
Tomek


More information about the Digitalmars-d mailing list