D - assert syntax
- Sean L. Palmer (6/6) Jun 15 2002 just wondering if assert could be made syntactically more like return
- Walter (4/10) Jun 15 2002 Assert is implemented as an expression, not a statement, so leaving off ...
- Pavel Minayev (3/5) Jun 16 2002
- Walter (5/9) Jun 16 2002 wrote:
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; }
Jun 15 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.
Jun 15 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?
Jun 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:theAssert is implemented as an expression, not a statement, so leaving offYes. (You obviously think like I do <g>.)() would cause some parsing ambiguities.And what's it type? void?
Jun 16 2002