Opportunities for D

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 9 17:24:18 PDT 2014


On 07/09/2014 09:50 PM, Walter Bright wrote:
> On 7/9/2014 7:37 AM, Timon Gehr wrote:
>> On 07/08/2014 11:22 PM, Walter Bright wrote:
>>> 3. 'ref' means 'borrowed', to use Rust's terminology
>>> We're almost there with this. This means better escape analysis, too.
>> What makes you think that 'ref' is a good match for this
>> functionality, and how
>> are we almost there with this?
>
> 'ref' is already used conventionally in such a manner as implying it is
> borrowed. 'ref' pointers cannot be stored,

Borrowed pointers can be stored in data structures and they can be 
reassigned.

> and one cannot take the address of a ref'd variable in @safe code.
> ...

Borrowed should also be enforced in @system code by default.
Also, how do I borrow a class reference?

>
>
>>> 8. NotNull!T type
>>>
>>> For those that want a non-nullable reference type. This should be doable
>>> as a library type.
>> No.
>
> Rationale?

null


More information about the Digitalmars-d mailing list