why scope(success)?

Sean Kelly sean at f4.ca
Wed May 10 11:27:33 PDT 2006


Ben Hinkle wrote:
>>> And it is kind of obscure code for me - it can be anywhere in function, 
>>> maybe even may times, etc... It's hard to maintain (just like goto's), 
>>> and as so, it's no use for me at this point.
>> It's a matter of opinion, I suppose.  I find scope declarations more 
>> visible and more meaningful than the alternatives.  And I like that I can 
>> place them next to the declarations of data they're meant to affect, thus 
>> making the code more meaningful.
> 
> Are you using them in practice? Is there a link I can follow to see the 
> code?

scope(success)?  Not yet.  I've only used scope(failure) and scope(exit) 
so far:

http://svn.dsource.org/projects/ares/trunk/src/ares/std/array.d
http://svn.dsource.org/projects/ares/trunk/src/ares/std/thread.d

I do think the use of scope(success) is fairly limited--the DB example 
is one of the I can think of--but it's a nice option to have.

Sean



More information about the Digitalmars-d mailing list