DIP 1009--Improve Contract Usability--Preliminary Review Round 1

MysticZach via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 23 07:24:21 PDT 2017


On Friday, 23 June 2017 at 13:58:38 UTC, Moritz Maxeiner wrote:
> OT: Anyone interested in a DIP for more template constraint 
> unfulfilled information in a consistent way to contracts (?) :
> ---
> int myFunc(Args...)(Args args)
>   if (Args.length > 0, "Starving!")
>   if (Args.length > 1, "Still hungry!")
>   if (Args.length > 2, "Just a little bit more!")
>   in (args[0] != 0, "Yikes!")
>   in (args[1] > 1, "Why you do this?")
>   out (result; result > 0, "Oops...") { ... }
> ---

This would be a good question for a different thread.


More information about the Digitalmars-d mailing list