[swift-evolution] SE-0045 Add scan, prefix(while:), drop(while:), and unfold to the stdlib
wjs at mac.com
Sat Apr 30 04:29:34 CDT 2016
func drop(@noescape while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence
func prefix(@noescape while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence
Now I may just be a simple country hyper-chicken, but so I don’t know if there are other languages that inspired the names of these functions, but it ruffles my feathers that we have the words “drop” and “prefix” for two functions that are kind of symmetric, instead of symmetric words like “drop” and “keep” or “prefix” and “suffix”.
Not that I’m in love with those particular examples, I’m just saying I’d like it if there were some symmetry in the words that suggested the symmetry of the functions. But, again, maybe these are, like, some standard terms that I just missed out on and everyone would hate it if we didn’t use the standard name, like if we renamed “cos()” to “adjacentOverHypotenuse()”.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution