Vision for the D language - stabilizing complexity?

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 12 08:07:06 PDT 2016


On 7/12/16 10:40 AM, Andrei Alexandrescu wrote:
> On 07/12/2016 10:26 AM, H. S. Teoh via Digitalmars-d wrote:
>> On Tue, Jul 12, 2016 at 01:33:00AM -0400, Andrei Alexandrescu via
>> Digitalmars-d wrote:
>>> On 07/12/2016 01:15 AM, Shachar Shemesh wrote:
>> [...]
>>>> Casting away immutability is UB in D.
>>>
>>> I understand. There is an essential detail that sadly puts an
>>> anticlimactic end to the telenovela. The unsafe cast happens at
>>> allocator level.
>> [...]
>>
>> What's an "unsafe cast"?  I think we're mixing up terminology here,
>> which is not helping this discussion.
>>
>> Is casting away immutable merely *unsafe*, or is it UB?
>
> The subtlety here is that immutable is not being cast away. All data
> that is typed as immutable stays immutable. -- Andrei

A related question: are we planning on making such access pure (or even 
allowing compiler to infer purity)? If so, we may have issues...

-Steve


More information about the Digitalmars-d mailing list