DIP1000: Scoped Pointers (Discussion)

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 11 02:26:55 PDT 2016


On 11/08/2016 9:06 PM, Robert burner Schadek wrote:
> ```
> void foo() {
>     int c;
>
>     ....
>     int* e;
>     e = &c; // Error, lifetime(e's view) is ∞ and is greater than
> lifetime(c)
> }
> ```
>
> The DIP should make clear that this is wanted for a container library.
> Additionally, I miss how this DIP fits in the overall plan of getting
> rid of the GC. As long as there isn't a written masterplan how to
> combine those ideas I consider this DIP to be incomplete.
>
> I think this change is not worth it. I believe there is an inherent
> trade-off for every programming language between usability and
> theoretically correctness. And IMO this DIP is pushing D way to far in
> the direction of theoretically correctness. There are far more important
> things for the adoption of D, like making the frontend a library,
> shipping with multiple backends.

I strongly disagree with this.
If you need proof of where it can be used checkout my managed[0] memory 
concept.

[0] 
https://github.com/rikkimax/alphaPhobos/blob/master/source/std/experimental/memory/managed.d



More information about the Digitalmars-d mailing list