DIP69 - Implement scope for escape proof references
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Fri Dec 12 14:04:20 PST 2014
On 12/12/2014 2:28 AM, deadalnix wrote:
> On Friday, 12 December 2014 at 08:44:56 UTC, Walter Bright wrote:
>> On 12/12/2014 12:16 AM, deadalnix wrote:
>>> On Friday, 12 December 2014 at 07:48:21 UTC, Walter Bright wrote:
>>>> Are you suggesting two kinds of scope - transitive and non-transitive?
>>>>
>>>
>>> Non transitive scope can be added without any language extension.
>>
>> In order for it to work, the holes in the language that enabled escapes had to
>> be plugged. That's what this proposal does - plug the holes.
>>
>
> The holes covered by a non transitive scope are already undefined behavior.
Right, but since the current compiler cannot detect them, it is a hole.
>>> ref counting is just one form of ownership.
> > My point is if that works with this proposal, then the other forms can work, too.
> No, unless we wrap every single indirection (pointer, slice, classes, delegates)
> into a wrapper. That is not going to fly very far.
The beauty of GC is that you don't have to do any of this. To have safe other
methods of allocation, there has to be annotation everywhere or use a wrapped
type in the same places.
More information about the Digitalmars-d
mailing list