[swift-evolution] Code Contracts

Javier Soto javier.api at gmail.com
Thu Jan 14 22:36:57 CST 2016


Is this something that in your opinion is worth extra, special syntax?
Those examples could be implement easily like:

didSet {
precondition(score <= 100)
}


On Thu, Jan 14, 2016 at 8:32 PM Suminda Dharmasena <sirinath1978m at gmail.com>
wrote:

> E.g.
>
>
>    1. var @where("myVariable <= 100 && myVariable >= 0") myVariable = 42
>
>
>
>
>    1. @where("myVariable <= 80 && myVariable >= 50")
>    2. {
>    3. ...
>    4. }
>
>
>
>
>    1. @where("score <= 100 && score >= 0")
>    2. for score in individualScores {
>    3. ...
>    4. }
>
> --
Javier Soto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160115/38e89486/attachment.html>


More information about the swift-evolution mailing list