Is it true scope declarations are being removed?

2011-01-21 Thread Sean Eskapp
Someone mentioned to me that scope declarations, e.g. scope class A{} or scope A myNewObject; are being removed from the language. Is this true? If so, how will RAII-type classes be implemented?

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Trass3r
Sadly true. They intend to replace it with a library based solution, I don't know why.

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Andrej Mitrovic
I don't understand it either. AFAIK they are being removed because they're unsafe, and are being replaced by an unsafe library solution.

Re: Is it true scope declarations are being removed?

2011-01-23 Thread bearophile
Andrej Mitrovic: > I don't understand it either. AFAIK they are being removed because > they're unsafe, and are being replaced by an unsafe library solution. I have hated see typedef and scoped classes go (I have even missed delete), but you need a bit of faith in the future and in Andrei & Walt

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Trass3r
I don't understand it either. AFAIK they are being removed because they're unsafe, and are being replaced by an unsafe library solution. I have the same feeling. While I do understand why typedef is poorly designed (http://d.puremagic.com/issues/show_bug.cgi?id=5467) I can't imagine how a li

Re: Is it true scope declarations are being removed?

2011-01-23 Thread so
On Mon, 24 Jan 2011 00:11:48 +0200, Trass3r wrote: Sadly true. They intend to replace it with a library based solution, I don't know why. If the library solution is as good as the original, it is a big plus. If only we could do the same for everything!

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Jonathan M Davis
On Friday 21 January 2011 06:10:26 Sean Eskapp wrote: > Someone mentioned to me that scope declarations, e.g. > > scope class A{} > or > scope A myNewObject; > > are being removed from the language. Is this true? If so, how will > RAII-type classes be implemented? std.typecons.scoped is the repl

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Trass3r
scope declarations are going away because they're inherently unsafe. Pointers are inherently unsafe as well ;)

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Jonathan M Davis
On Monday 24 January 2011 00:37:40 Trass3r wrote: > > scope declarations are going away because they're inherently unsafe. > > Pointers are inherently unsafe as well ;) Well, you can't take those out of the core language and put them in the standard library. And there _are_ cases where pointers

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Kagamin
bearophile Wrote: > If you remove it, you will have plenty of time in future to add it back, add > something better implementation of it, or to find a better and very different > solution, or even to add a more general language feature that allows you to > implement the original half-broken fea

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Steven Schveighoffer
On Sun, 23 Jan 2011 19:03:19 -0500, so wrote: On Mon, 24 Jan 2011 00:11:48 +0200, Trass3r wrote: Sadly true. They intend to replace it with a library based solution, I don't know why. If the library solution is as good as the original, it is a big plus. If only we could do the same for e

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Andrej Mitrovic
On 1/24/11, Steven Schveighoffer wrote: > This means, you can "scope" a class inside another statement instead of > having to declare/initialize it separately. It solves a bug I filed: > > http://d.puremagic.com/issues/show_bug.cgi?id=2070 > > -Steve > That is pretty cool. What I worried about i

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Steven Schveighoffer
On Mon, 24 Jan 2011 09:41:30 -0500, Andrej Mitrovic wrote: On 1/24/11, Steven Schveighoffer wrote: This means, you can "scope" a class inside another statement instead of having to declare/initialize it separately. It solves a bug I filed: http://d.puremagic.com/issues/show_bug.cgi?id=207

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Andrej Mitrovic
On 1/24/11, Steven Schveighoffer wrote: > That wasn't done by the compiler anyways. > > -Steve > Yeah I've noticed that. Lazy DMD compiler! :)

Re: Is it true scope declarations are being removed?

2011-01-24 Thread Jonathan M Davis
On Monday 24 January 2011 07:49:44 Andrej Mitrovic wrote: > On 1/24/11, Steven Schveighoffer wrote: > > That wasn't done by the compiler anyways. > > > > -Steve > > Yeah I've noticed that. Lazy DMD compiler! :) Much of anything that requires code flow analysis doesn't tend to happen. And it's

Re: Is it true scope declarations are being removed?

2011-01-24 Thread bearophile
Jonathan M Davis: > Much of anything that requires code flow analysis doesn't tend to happen. Right. You need (lot of) work to implement it, in a system language it can't be fully accurate, and it may slow down compilation a little (Scala compiler is powerful, but I don't think it's very fast).