DIP69 - Implement scope for escape proof references

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 11 14:53:54 PST 2014


On Thursday, 11 December 2014 at 21:41:11 UTC, Walter Bright 
wrote:
> On 12/11/2014 4:47 AM, Manu via Digitalmars-d wrote:
>> On 8 December 2014 at 07:29, Walter Bright via Digitalmars-d
>> <digitalmars-d at puremagic.com> wrote:
>>> On 12/7/2014 6:12 AM, Dicebot wrote:
>>>>
>>>> But from existing cases it doesn't seem working good enough. 
>>>> For example,
>>>> not
>>>> being able to represent idiom of `scope ref int foo(scope 
>>>> ref int x) {
>>>> return x;
>>>> }` seems very limiting.
>>>
>>>
>>>   scope ref int foo(ref int x);
>>>
>>> will do it.
>>
>> Will it? It looks like foo can't be called with scope data?
>
> Yes, it can be.
>
>
>> I don't have the perfect proposal, but I feel very strongly 
>> about 2 things:
>> 1. It must not be a storage class; the concept was a disaster 
>> with
>> ref, and I struggle with this more frequently than any other 
>> 'feature'
>> in D.
>
> I simply do not understand why distinguishing beteen ref and 
> not-ref is a cornerstone of everything you do.

Because he requires control over function ABIs for both 
inter-language communication and performance.

In binding D to IDL (Interactive Data, not Interface Description) 
I found ref often required special casing.


More information about the Digitalmars-d mailing list