Thread overview
assert syntax
Jun 15, 2002
Sean L. Palmer
Jun 16, 2002
Walter
Jun 16, 2002
Pavel Minayev
Jun 16, 2002
Walter
June 15, 2002
just wondering if assert could be made syntactically more like return (doesn't need parenthesis, but it's ok if they're present):

void foo(int x)
{
   assert x < 5;
}


June 16, 2002
"Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aef8gf$2lbm$1@digitaldaemon.com...
> just wondering if assert could be made syntactically more like return (doesn't need parenthesis, but it's ok if they're present):
>
> void foo(int x)
> {
>    assert x < 5;
> }

Assert is implemented as an expression, not a statement, so leaving off the () would cause some parsing ambiguities.


June 16, 2002
On Sat, 15 Jun 2002 23:07:50 -0700 "Walter" <walter@digitalmars.com> wrote:

> Assert is implemented as an expression, not a statement, so leaving off the () would cause some parsing ambiguities.

And what's it type? void?
June 16, 2002
"Pavel Minayev" <evilone@omen.ru> wrote in message news:CFN374234893359722@news.digitalmars.com...
> On Sat, 15 Jun 2002 23:07:50 -0700 "Walter" <walter@digitalmars.com>
wrote:
>
> > Assert is implemented as an expression, not a statement, so leaving off
the
> > () would cause some parsing ambiguities.
>
> And what's it type? void?

Yes. (You obviously think like I do <g>.)