On Monday, 8 December 2014 at 23:00:05 UTC, deadalnix wrote:
This is inherently about ownership. I have a proposal about
this.
Scope is about using things without ownership.
Both are linked but different beast.
Not really different. The activation record (stack frame) is
conceptually an object. Scoped objects are owned by the
activation record. You have the same problem when handing out
references to parts of composite objects.
When propagating references down a call chain you can keep track
of the associated call-depth, when the call-depth associated with
the reference is greater than 0, then it safe to return the
reference from a function. Right?