[Dlang-internal] DIP1000 discussion and testing

Dicebot via Dlang-internal dlang-internal at puremagic.com
Thu Oct 20 15:52:18 PDT 2016


On 10/21/2016 12:36 AM, Walter Bright wrote:
> On 10/20/2016 12:27 PM, Dicebot wrote:
>> If I was to judge by available test cases only, I would have decided
>> DIP1000 is waste of time and brings nothing useful to the table. They
>> are terrible in showing implementation goals being low level regression
>> testing artifacts.
>>
>> Really, do you think anyone will ever be impressed seeing code like
>> `int* foo1(return scope int* p) { return p; }`? DIP1000 as defined can
>> allow much more interesting things and tests should show that too, not
>> just synthetic artifacts.
> 
> They are not meant to impress people, nor are they regression tests.
> They illustrate closing of existing safety holes.
> 
>   int* bar()
>   {
>     int p;
>     return foo1(&p);
>   }
> 
> is a currently undetected bug. DIP1000 detects it. DIP1000 also closes
> safety bugs that you posted to Bugzilla (listed in the PR for it).

Yes, but that is not enough for such a major change. If we want to
finally implement `scope`, it has to be _awesome_, plain good is not
good enough.

> Yes, the test cases are very minimal. But understanding them is
> necessary in order to understand more complex cases - I don't think
> we've gotten anywhere by using complex cases to understand the mechanics
> of it.

Can you give a clear answer regarding borrowing snippets I am posting?
Like one of:

- Such idioms are not supposed to work with DIP1000 at all (why?) and
you only want to focus on fixing existing @safe holes
- It is supposed to work, but I am doing it wrong (please show how to
write it in that case)
- It is supposed to work, but bugs need fixing
- It is supposed to work, but some parts will be implemented later
(which ones?)

So far you have only given answers regarding technical trivialities
without taking actual example to the heart.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/dlang-internal/attachments/20161021/0ddf6bf2/attachment.sig>


More information about the Dlang-internal mailing list