Thread overview | |||||
---|---|---|---|---|---|
|
July 08, 2009 assert | ||||
---|---|---|---|---|
| ||||
I'm tired and witless just now, but I can't think of any reason why assert should be an expression and not a statement. Any clues? |
July 08, 2009 Re: assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | Ellery Newcomer Wrote:
> I'm tired and witless just now, but I can't think of any reason why assert should be an expression and not a statement.
>
> Any clues?
A requirement for assert expression to be inside ExpressionStatement?
|
July 08, 2009 Re: assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | Ellery Newcomer wrote: > I'm tired and witless just now, but I can't think of any reason why > assert should be an expression and not a statement. > > Any clues? assert only evaluates to void but maybe someone writes something like: module test; import std.stdio; void main() { bool readyForMath = true; int i = 2; int result = (assert(readyForMath),i*=i,i++); writeln(i); } |
Copyright © 1999-2021 by the D Language Foundation