www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Request for additiona DDoc sections

reply Sean Kelly <sean f4.ca> writes:
In: for preconditions
Out: for postconditions

Also, it might be nice if inline comments were labeled as being a part of
in/out/body if contracts are present.


Sean
Oct 14 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Sean Kelly" <sean f4.ca> wrote in message
news:dip2pc$j38$1 digitaldaemon.com...
 In: for preconditions
 Out: for postconditions

 Also, it might be nice if inline comments were labeled as being a part of
 in/out/body if contracts are present.
But preconditions are part of "Params" and postconditions are part of "Returns".
Oct 14 2005
parent Sean Kelly <sean f4.ca> writes:
In article <dip9p9$ooa$1 digitaldaemon.com>, Walter Bright says...
"Sean Kelly" <sean f4.ca> wrote in message
news:dip2pc$j38$1 digitaldaemon.com...
 In: for preconditions
 Out: for postconditions

 Also, it might be nice if inline comments were labeled as being a part of
 in/out/body if contracts are present.
But preconditions are part of "Params" and postconditions are part of "Returns".
I agree for the most part, though I've noticed that not all of my preconditions are related to input parameters--some check certain aspects of object state (it is a logic error to call Thread.start() multiple times, for example). I suppose an invariant could handle this for the out clause, however, so perhaps adding in/out sections isn't quite right after all. I may just document these requirements in the function description instead. Sean
Oct 14 2005