DIP1000: Scoped Pointers (Discussion)

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 12 13:58:05 PDT 2016


On 12.08.2016 22:22, Andrei Alexandrescu wrote:
> On 08/12/2016 03:34 PM, Timon Gehr wrote:
>> On 10.08.2016 22:36, Dicebot wrote:
>>> http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org
>>>
>>> The first DIP has just landed into the new queue. It is a proposal from
>>> language authors and thus it bypasses usual nitpicking process and
>>> proceeds straight to requesting community (your!) feedback.
>>>
>>> Essentially, it is an attempt to solve reference lifetime problem by
>>> extending implementation of `scope` keyword.
>>>
>>> Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md
>>
>> This proposes to add a kind of information the type system is supposed
>> to track (lifetimes), which cannot be communicated losslessly across
>> function and aggregate boundaries. Hence it won't work well in its
>> current form.
>
> Could it work in a restricted manner, yet permissive enough to be
> useful? -- Andrei

The issue is that there is information that the type system tracks that 
cannot be passed around effectively at the type system level.

This generally leads to a painful "fighting-the-compiler" experience 
when trying to use the feature in a not-completely-trivial capacity 
(c.f. inout, it is also a case of this). I think users of the language 
generally expect features to compose. So even if it is useful for the 
handful of special cases it was designed for, there will be a lot of 
complaints.


More information about the Digitalmars-d mailing list