Proposal: Relax rules for 'pure'
Steven Schveighoffer
schveiguy at yahoo.com
Wed Sep 22 12:26:10 PDT 2010
On Wed, 22 Sep 2010 15:21:57 -0400, klickverbot <see at klickverbot.at> wrote:
> On 9/22/10 9:14 PM, Steven Schveighoffer wrote:
>> Hypothetical counter-case
>>
>> struct S
>> {
>> version(stronglypure)
>> string s;
>> else
>> char[] s;
>> }
>>
>> pure foo(S s); // changes strength depending on S' contents
>>
>> -Steve
>
> This is a change to the signature of foo – S with the stronglypure
> version defined and S without it are two completely distinct types.
Wait, I didn't change foo's signature at all. This is what the OP meant
by long-range changes. S can be defined far away from foo, and out of the
author of foo's control.
-Steve
More information about the Digitalmars-d
mailing list