We don't have a formal document yet, though the matter is pretty clear
to us. Consider:

class X {
...
void method() { ... }
}

void fun() {
scope x = new X;
x.method();
}

Now consider what steps you need to make sure that the code is safe.
Essentially x must not escape the scope of foo(). But x is passed inside
method() as "this". So the compiler must make sure that method() does
not escape "this". But then method() may call other functions and pass
"this" to them, or may not even be available to the compiler at the
point where scope is used. This is an unsolvable problem without making
extensive changes to the language.

As I'm sure you know we're trying to help the matter with library-based
approaches, but leaving straight in the language a feature that is
impossible to make safe is not admissible. Walter and I agree that scope
must be abolished.


Andrei

I understand it well. Thank you.
When is it going to mark deprecated? D3?
I think that you had better announce it as soon as possible.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to