DIP 1009--Improve Contract Usability--Preliminary Review Round 1
Olivier FAURE via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jun 27 02:18:11 PDT 2017
On Friday, 23 June 2017 at 17:31:15 UTC, MysticZach wrote:
>
> Yeah, my take is that the grammar for `assert`s applies to the
> new syntax as well. If the grammar for asserts is this:
>
> AssertExpression:
> assert ( AssertParameters )
>
> ... then the grammar for the new syntax is:
>
> InExpression:
> in ( AssertParameters )
>
> OutExpression:
> out ( ; AssertParameters )
> out ( Identifier ; AssertParameters )
A bit late to the party, but I would recommend the following
syntax:
out (void; myTest)
for argument-less tests. A casual reader would be less likely to
see this in code and think it's some sort of typo; it would be
easier to google; and it would make some semantic sense
(functions that don't return anything return void).
More information about the Digitalmars-d
mailing list