auto storage class - infer or RAII?

Bill Baxter dnewsgroup at billbaxter.com
Sun Nov 12 19:17:00 PST 2006


Andrey Khropov wrote:
> Bill Baxter wrote:
> 
>> "scope" seems a pretty popular suggestion.
>> I find it not so bad myself, but I would prefer "scoped" because it's less
>> ambiguious.  "scope" makes sense if you think of scope as a verb (scope this
>> variable), but just seeing it outside of a sentence it looks like a noun
>> (this variable is a scope -- huh?), simply because 'scope' isn't used as a
>> verb very often in English.
>>
>> 'scoped' is clearly an adjective, as in 'this variable is scoped'. 
> 
> Yes I also thought of 'scoped'. Sounds like a good idea to me.

I realized 'scope' is already a keyword.  I think that's why people are 
gravitating towards that instead of the more natural 'scoped'.

I think the globally optimum solution would be to make the other 'scope' 
into 'scoped' too.

     scoped(exit) writefln("leaving now");

That reads just fine to me.  Whereas

     scope var = new Class;

looks funny.  Oh well.  Probably hopeless.

--bb



More information about the Digitalmars-d mailing list