DMD 0.148 - scope guard

Derek Parnell derek at psych.ward
Mon Feb 27 10:33:11 PST 2006


On Tue, 28 Feb 2006 04:40:56 +1100, Chris Miller <chris at dprogramming.com>  
wrote:

> On Sat, 25 Feb 2006 21:06:36 -0500, Walter Bright  
> <newshound at digitalmars.com> wrote:
>
>> Scope guards are a novel feature no other language has. They're based on
>> Andrei Alexandrescu's scope guard macros, which have led to considerable
>> interest in the idea. Check out the article
>> www.digitalmars.com/d/exception-safe.html
>>
>
> This format looks good to me:
>
> scope(exit)  foo();
> scope(success)  bar();
> scope(failure)  baz();
>
> similar to extern(name), pragma(name), etc, requires one `scope`  
> keyword, name in () doesn't need to be a keyword but is still treated  
> special, and doesn't look bad.

Nice and consistent.

-- 
Derek Parnell
Melbourne, Australia



More information about the Digitalmars-d mailing list