Feature request: Optional, simplified syntax for simple contracts

Manu turkeyman at gmail.com
Mon Jun 17 22:27:54 PDT 2013


What about the argument list only 3 characters earlier?


On 18 June 2013 15:16, Aleksandar Ruzicic <aleksandar at ruzicic.info> wrote:

> On Sunday, 16 June 2013 at 00:19:37 UTC, Manu wrote:
>
>> Super awesome idea! How about coma separated expressions to perform
>> multiple asserts?
>>
>> int func(int i, int j) in(i<5, j<10)
>> {
>>   return i + j;
>> }
>>
>
> I find use of comma inside of parentheses of a statement a bit unusual.
> Correct me if I'm wrong but I don't think there is a single statement in D
> that separates it's "parts" with a comma. It's always a semi-colon.
>
> So I think it should be:
>
> int func(int i, int j) in (i < 5; j < 10)
> {
>   return i + j;
> }
>
>
> But either comma or a semi-colon used as a separator, this is a really
> nice syntactic sugar!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130618/5d170131/attachment.html>


More information about the Digitalmars-d mailing list