Re: static foreach, expression-Based Contract Syntax and better error messages

2018-08-16 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 7 August 2018 at 08:20:55 UTC, Basile B. wrote: On Tuesday, 7 August 2018 at 07:33:49 UTC, Nicholas Wilson wrote: so the following void foo(As...)(As as) in { static foreach (a ;as) assert(a>0); } do { } void main() { foo(1,2,3,4,5); } passes and compiles, whereas void

Re: static foreach, expression-Based Contract Syntax and better error messages

2018-08-07 Thread Basile B. via Digitalmars-d
On Tuesday, 7 August 2018 at 07:33:49 UTC, Nicholas Wilson wrote: so the following void foo(As...)(As as) in { static foreach (a ;as) assert(a>0); } do { } void main() { foo(1,2,3,4,5); } passes and compiles, whereas void foo(As...)(As as) static foreach (a ;as) in(a>0) { } voi

static foreach, expression-Based Contract Syntax and better error messages

2018-08-07 Thread Nicholas Wilson via Digitalmars-d
so the following void foo(As...)(As as) in { static foreach (a ;as) assert(a>0); } do { } void main() { foo(1,2,3,4,5); } passes and compiles, whereas void foo(As...)(As as) static foreach (a ;as) in(a>0) { } void main() { foo(1,2,3,4,5); } does not compile. I suppose tha

Re: Expression based contract syntax

2018-05-17 Thread Mike Franklin via Digitalmars-d
On Friday, 18 May 2018 at 05:28:10 UTC, Arun Chandrasekaran wrote: Has this been implemented in DMD master? So I was looking at the changelog[1] and tried to build the example, but it erred. https://github.com/dlang/dmd/blob/master/changelog/expression-based_contract_syntax.dd https://githu

Expression based contract syntax

2018-05-17 Thread Arun Chandrasekaran via Digitalmars-d
Has this been implemented in DMD master? So I was looking at the changelog[1] and tried to build the example, but it erred. https://github.com/dlang/dmd/blob/master/changelog/expression-based_contract_syntax.dd