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 safel
On Monday, 17 November 2014 at 20:07:54 UTC, Freddy wrote:
Why not make the compiler copy the variable how's address is
taken to the heap like how a closure does it? Would it be hard
that optimize away?
int* c;
int main(){
int a;
int* b=&a;//a is now a reference to the heap
c=
On Friday, 14 November 2014 at 01:21:07 UTC, Walter Bright wrote:
Thought I'd bring this up as deadalnix is working on a related
proposal. It uses 'scope' in conjunction with 'ref' to resolve
some long standing @safe issues.
---
**Background
The goal of @sa
Remembers me a bit of http://wiki.dlang.org/DIP36
On Friday, 14 November 2014 at 01:21:07 UTC, Walter Bright wrote:
ref T foo() @safe {
T t;
ref T func() { return t; }
auto dg = &func;
return dg(); // should be disallowed
}
ref T f(ref T delegate() dg)
{
return dg(); //ok?
}
On Friday, 14 November 2014 at 05:38:34 UTC,
On 11/13/2014 9:36 PM, Walter Bright wrote:
Got a handy link to it?
Found it:
http://wiki.dlang.org/User:Schuetzm/scope
On 11/13/2014 7:41 PM, Manu via Digitalmars-d wrote:
I'm not quite clear; are you suggesting 'scope ref' would be a storage
class?
Yes.
(looks like it, but it also affects mangling?)
Only for function types.
Please, consider Marc Schütz's existing proposal.
Please, please, don't make scop
On 14 November 2014 11:20, Walter Bright via Digitalmars-d
wrote:
> Thought I'd bring this up as deadalnix is working on a related proposal. It
> uses 'scope' in conjunction with 'ref' to resolve some long standing @safe
> issues.
> ---
>
> **Background
>
> The
Thought I'd bring this up as deadalnix is working on a related proposal. It uses
'scope' in conjunction with 'ref' to resolve some long standing @safe issues.
---
**Background
The goal of @safe code is that it is guaranteed to be memory safe. This is
mostly