On Tuesday, 9 December 2014 at 19:39:31 UTC, Ola Fosheim Grøstad
wrote:
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?
That why i say they are linked. I don't think your way of stating
it contradict what I said.
scope allow for manipulation of data without owning them.
Whatever the owner is (be it the stack frame or anything else)
doesn't really matter here.