DConf 2013 Day 1 Talk 2 (Copy and Move Semantics)

Dmitry Olshansky dmitry.olsh at gmail.com
Sun May 12 23:11:18 PDT 2013


13-May-2013 02:47, Walter Bright пишет:
> On 5/12/2013 1:48 PM, Dmitry Olshansky wrote:
>> 13-May-2013 00:28, Walter Bright пишет:
>>> On 5/12/2013 6:01 AM, Andrei Alexandrescu wrote:
>>>> Bartosz, Walter and I reached a similar design a few years ago. We
>>>> just thought
>>>> it complicates things too much for what it does.
>>>
>>> I've been working in the background on a scheme that can infer
>>> uniqueness. The beauty of it is it will not require visible language
>>> changes - it's just that things that didn't compile before now will.
>>
>> Good things these are, but that adds up to what a programmer should
>> know or we
>> are stuck trying out combinations that might work until we hit it.
>
> I think programmers will find it to be intuitive, not magical.
>

By the end of day we need guarantees not intuition which is the problem.

Compare the statement in the would be standard of D:
"If the compiler can prove that the expression is unique it's implicitly 
convertible to shared/immutable/const."
vs
"The following rules define what kinds of if the expression is unique. 
[...] Unique expression is convertible to shared/immutable/const."

The keyword "the compiler can prove" - it doesn't state anything 
reliable. In the long run I'd prefer the second and exact formal rules 
and if they are too hard to explain we'd better not do it at all.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list