The missing bit in DIP1000
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Thu Jun 23 16:43:21 UTC 2022
On Thursday, 23 June 2022 at 10:17:44 UTC, rikki cattermole wrote:
> I like it.
>
> It solves non-nullable types and scope as a type constructor.
On second thoughts, scope has to provide stack-depth information
in order to build simple stuff like linked lists where life times
matter.
So `scope!0` would be "function scope" and `scope!1` would be
some stack frame further down the stack than `scope!0`. `scope!2`
would be some stack frame further down than `scope!1` etc.
Then you can connect two nodes in a single linked list:
```
void connect(scope!1(node)* a, (scope!1(node)|scope!2(node))* b){
a.next = b;
}
```
Hmm… But the syntax needs some work.
Also, it has to be compared to standard life time annotations
which is more general.
More information about the Digitalmars-d
mailing list