News for hackers. Stuff that matters.
Re:Swift is like Kotlin by throwaway91111 on Thursday May 18, 2017 @12:23AM (#14364796)
I can't tell whether this is sarcasm or not. What does the '<' mean in this case? I'm assuming an exclusive upper bound.
Re:Swift is like Kotlin by Larrikin on Thursday May 18, 2017 @12:30AM (#14364824)
Is there any language where the meaning isn't immediately clear? I haven't seen a language that didn't differentiate between '<=' and '<'. The syntax of just '..' is a little unclear at first however, but it is simply a requirement of learning the language and the idioms
Re:Swift is like Kotlin by zem on Thursday May 18, 2017 @12:59AM (#14364923)
it's not. i've never used swift, and the meaning was instantly obvious - i'd call that a very elegant solution to a common problem i've seen in several languages.
Re:Swift is like Kotlin by taurath on Thursday May 18, 2017 @12:30AM (#14364823)
Read it as "For 0 to count" basically. "0... (spread operator) less than 0. It seems confusing to me as well at first read but I'm used to writing for loops by hand uphill both ways.