D 2.0

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jul 25 08:00:28 PDT 2010


On 07/25/2010 08:22 AM, bearophile wrote:
> Trass3r:
>> Now they seem to intend to remove scope too (didn't read the topic
>> thoroughly though, I'm sick of all those "remove every single
>> keyword there is in the language" threads)
>
> The Scope!() replacement for scope is not good enough yet: 1) The
> compiler doesn't test for escapes (as dmd currently naively does for
> scoped objects); 2) There is no way to denote a class that must be
> scoped; 3) There is this problem:
> http://d.puremagic.com/issues/show_bug.cgi?id=4500
>
> I think Andrei's (wrong) strategy is to remove things first, and then
> try to invent ways to patch the holes left by the removed stuff. So
> far the idea of removing scope is a failure, it produces more
> problems than it solves.

The issue is that the scope keyword is impossible to check against 
escapes without extra additions to the language (e.g. marking a method 
or a function parameter as scoped). Such an uncheckable pattern is best 
left to a library feature, it doesn't deserve a keyword. I agree that 
scoped() has weaknesses that should be looked into, but scope must go.

Andrei


More information about the Digitalmars-d mailing list