[swift-evolution] Limit checking syntax
dabrahams at apple.com
Fri Apr 8 13:21:41 CDT 2016
on Fri Apr 08 2016, "Vladimir.S via swift-evolution" <swift-evolution at swift.org> wrote:
> On 08.04.2016 4:14, Harlan Haskins via swift-evolution wrote:
>> I’ve found that .contains works well for all my uses.
> Hmm.. Isn't next construction is much more readable?:
API guidelines prescribe this should read as an assertion about x, so:
> I think it is much more readable.
> We are planning(in head) to verify "if x value is in range from 0 up
> to 99", so why we have to write "for some range 0 to 9 let's check if
> it contains our x value".
> Our x is a subject of our check, not range (0..<100).
> I.e. in my opinion -1 for 'in' operator like suggested in initial message,
> but +1 for .in method for integer to check against range
> Any additional opinion?
> (P.S. Sorry for duplicate.)
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution