June 05, 2011 Cover handler for a statement or a block of statements. | ||||
|---|---|---|---|---|
| ||||
I would like to suggest a method for defining code statement
covering. Some examp1es of a cover are as follows :-
- try ... finally - this is defined in dotnet as a using
- try ... (catch)+
- cursor save and display others ... restore saved cursor
a possible syntax
cover Hourglass(Application &app)
{
Cursor save = app.cursor;
app.cursor = HOURGLASS_CURSOR;
~ code ~
app.cursor = save;
}
usage could be something like
mixin(Hourglass(application))
{
...
}
| ||||
June 05, 2011 Re: Cover handler for a statement or a block of statements. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Vincent Risi | On 05/06/2011 13:03, Vincent Risi wrote: > I would like to suggest a method for defining code statement > covering. Some examp1es of a cover are as follows :- > - try ... finally - this is defined in dotnet as a using > - try ... (catch)+ > - cursor save and display others ... restore saved cursor > > a possible syntax > > cover Hourglass(Application&app) > { > Cursor save = app.cursor; > app.cursor = HOURGLASS_CURSOR; > ~ code ~ > app.cursor = save; > } > > usage could be something like > > mixin(Hourglass(application)) > { > ... > } > You should re-post this on digitalmars.D.learn - this newsgroup is unused. -- Robert http://octarineparrot.com/ | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply