Scope and Ref and Borrowing

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 18 09:40:13 PST 2014


I have to say I mostly settled with Marc Schütz's approach to
lifetime management already, because it allows us to return
scope ref arguments from functions by directly declaring which
arguments the result can be referring to. So you can for
example write sub-string search algorithms that can safely
return part of the (scoped) input string.

There were also two or three other topics on the NG where it
seemed like his proposal would solve a problem with D's
expressiveness, contributing to an ever growing list of
use-cases that made me think that it is worth the added
complexity. It borrows from Rust's life-time checking, but
without getting too complex.

That said, more inference of attributes is always positive and
up to the point where you introduce a conflicting definition
of what scope arguments do, the proposals look compatible. So
+1 to that.

-- 
Marco



More information about the Digitalmars-d mailing list