[swift-evolution] Proposal: Add SequenceType.first

Brent Royal-Gordon brent at architechies.com
Sat Jan 2 14:13:41 CST 2016


> Why should we absolutely add methods with unclear meanings or behavior, when there are already perfectly clear, if verbose, alternatives? seq.generate().next() may not be nice, but no one can get fooled by it.

Well, for one thing, because it doesn't work. You can't call a mutating method directly on a return value without assigning it to a variable first. And put simply, a temporary variable seems a bridge too far to me.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list