Prototype of Ownership/Borrowing System for D
Radu
void at null.pt
Wed Nov 20 18:08:49 UTC 2019
On Wednesday, 20 November 2019 at 13:51:34 UTC, rikki cattermole
wrote:
> On 21/11/2019 1:16 AM, Timon Gehr wrote:
>> Right now, the only use I can see for @live is as an
>> incomplete and unsound linting tool in @system code. It
>> doesn't make @safe code any more expressive. To me, added
>> expressiveness in @safe code is the whole point of a borrowing
>> scheme.
>
> You touch upon a very good point.
>
> I'm starting to think of @live as a superset of @safe. With
> @trusted being an escape route. If this is the case then
> perhaps making all pointers non-null (with asserts) would make
> sense.
Indeed it looks that @live sits on top of @safe. I would love to
see this default to @safe when -preview=borrow (don't think it is
implemented ATM) is enabled.
I guess the reason for @live is backwards compatibility, but even
with this I think using @safe(own), name up to discussion -
meaning having @safe accept a parameter, would serve better to
limit the attribute soup.
More information about the Digitalmars-d
mailing list