classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: assert usage: Starting to use assertions.


From: Meskauskas Audrius
Subject: Re: assert usage: Starting to use assertions.
Date: Sat, 10 Sep 2005 09:48:34 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

That is really great. I start using assertions in my code.

Tom Tromey wrote:

"Robert" == Robert Schuster <address@hidden> writes:

Robert> Roman started using the assert statement.
Robert> Do we finally support this officially?

IMO we ought to.  We have all the runtime support.  All the compilers
we recommend support it (and usually give the option to disable code
generation for it).

Robert> Can we work out some recommendation when to use
Robert> assert ( expr ); OR
Robert> assert ( expr ) : "what to say here?"; OR

How about treating it like 'return' and only using parens if the line
wraps?

   assert something;

   assert something : something_else;

And, if you need to wrap the line, consider wrapping before the ':'
(i.e., treat it as an operator).

As for the optional message, I think that can be done on a
case-by-case basis.

Tom


_______________________________________________
Classpath mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/classpath







reply via email to

[Prev in Thread] Current Thread [Next in Thread]