April 11, 2018
On Friday, 6 April 2018 at 12:26:36 UTC, Mike Parker wrote:
> Congratulations to Zach Tollen and everyone who worked on DIP 1009. It took a painful amount of time to get it through the process, but it had finally come out of the other side with an approval. The proposal itself was approved early on, but it needed quite a bit of revision to get to an acceptable final draft. The DIP in its final form:
>
>
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1009.md

 What would have made contract trully powerful for me is them being emitted at caller side. This way if I use a release build of library but debugging my app I still get my stupidity guarded by contracts of the API. *

Now *that* would be marvelous. Otherwise having a debug build for each of libraries just to check my precondition is too much of drag I’d say. After all libraries are typically stable code that are (presumably) debugged and you want them to be fast.

* Templates kind of muddy the waters being conpiled with the flags of caller (another reason why they are a mess). Meaning they will work with contracts if caller choses to have debug build.
April 11, 2018
On Wed, Apr 11, 2018 at 08:45:15PM +0000, Dmitry Olshansky via Digitalmars-d-announce wrote: [...]
> What would have made contract trully powerful for me is them being emitted at caller side. This way if I use a release build of library but debugging my app I still get my stupidity guarded by contracts of the API. *
[...]

I say this should be the next step.  We should write up a DIP for this.


T

-- 
Creativity is not an excuse for sloppiness.
April 12, 2018
On Wednesday, 11 April 2018 at 20:45:15 UTC, Dmitry Olshansky wrote:
> * Templates kind of muddy the waters being conpiled with the flags of caller (another reason why they are a mess). Meaning they will work with contracts if caller choses to have debug build.

Template can call user code, but it wasn't tested for it, so the contract should be checked.
April 12, 2018
On Thursday, 12 April 2018 at 06:08:39 UTC, Kagamin wrote:
> On Wednesday, 11 April 2018 at 20:45:15 UTC, Dmitry Olshansky wrote:
>> * Templates kind of muddy the waters being conpiled with the flags of caller (another reason why they are a mess). Meaning they will work with contracts if caller choses to have debug build.
>
> Template can call user code, but it wasn't tested for it, so the contract should be checked.

What I mean is that for templates calling or not calling contracts depends on client code not the library. It’s just one consequence of template mechanism that has tons of other issues.
1 2 3
Next ›   Last »