Re: swift and objective-c
Re: swift and objective-c
- Subject: Re: swift and objective-c
- From: Gleb Dolgich <email@hidden>
- Date: Thu, 05 Jun 2014 10:25:16 +0100
I just thought of the following mnemonic: the first (leftmost) dot includes the left bound of the range, the second (middle) dot includes everything in between the bounds, and the third (rightmost) dot, if present, includes the right bound of the range.
-- Gleb On 5 Jun 2014, at 08:07, Chris Lattner < email@hidden> wrote: On Jun 3, 2014, at 8:19 PM, Jens Alfke < email@hidden> wrote: On Jun 3, 2014, at 2:16 PM, Ron Hunsinger < email@hidden> wrote: - In Swift, a..b includes a and excludes b; a...b includes both endpoints. - In Ruby, it's exactly the opposite. a..b includes both endpoints; a...b excludes b.
Oh, weird. I remembered the Ruby range operators when I read about Swift’s and assumed Ruby was the inspiration; but then why do them the other way around?
(But to me, it makes more sense that three dots would give you a bigger range than two dots. Shrug.)
The Swift approach is easy to remember: one more dot gives you one more value.
-Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden