DIP 1009--Improve Contract Usability--Preliminary Review Round 2 Begins
MysticZach via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 26 17:43:13 PDT 2017
On Tuesday, 25 July 2017 at 07:48:39 UTC, Andrea Fontana wrote:
> I don't like it so much but also something like this could be
> considered:
>
> out!(x => x>0)
> or maybe:
> out!x(x > 0)
>
> that can't collide with current syntax
>
> Andrea
It's another viable option, but it doesn't seem to stand out much
from the crowd. Most people, including me, seem to think `out(x;
x > 0)` and `out(; y > 0)` are the "least imperfect" option. I
suspect they would win if put to a vote. Maybe the leadership can
come up with something better. People will get used to whatever
is selected. I just like the foreach version because it's simple
and concise. I also don't think the ambiguous `out(x > 0)` syntax
is that bad for non-return variables. But I can also see why
that's suboptimal from a design point of view.
More information about the Digitalmars-d
mailing list