Thread overview | ||||||
---|---|---|---|---|---|---|
|
June 15, 2002 assert syntax | ||||
---|---|---|---|---|
| ||||
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 Re: assert syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "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 Re: assert syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 Re: assert syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "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>.) |
Copyright © 1999-2021 by the D Language Foundation