DIP 1009--Improve Contract Usability--Preliminary Review Round 1
Moritz Maxeiner via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 21 05:51:28 PDT 2017
On Wednesday, 21 June 2017 at 12:43:46 UTC, meppl wrote:
>
> yeah, i was probably not thinking too carefully about it. My
> idea was to keep the code readable, if the contracts are long.
> but as long as the "do" must appear behind a '}', everything is
> still fine, more or less.
>
> both are readable, but one time we write `do` and the other
> time we dont. furthermore the second function body looks a
> little bit like belonging to "out". someone who is learning the
> D-language might get confused.
Oh, I hadn't thought about mixing the two syntax forms. I would
just forbid it. Your signature then uses *either* the verbose
form, *or* the compact form.
More information about the Digitalmars-d
mailing list