[swift-evolution] [Proposal draft] Add `Clamp` function to standard library

Chris Lattner clattner at apple.com
Fri Sep 2 19:43:26 CDT 2016


> On Sep 2, 2016, at 9:55 AM, Nicholas Maccharoli via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Introduction
> 
> The aim of this proposal is to introduce clamp functionality to the swift standard library. The clamp function would take a value and a upper and lower bounds to clamp the value to, ensuring that the return value of the function is within the range specified by the upper and lower bounds. Swift-evolution thread: Discussion thread topic for that proposal <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160829/026748.html>
As others have pointed out, this is a purely additive change that is out of scope for Swift 4 stage 1.  We need to keep standard library work focused on things like String.

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160902/36f884ea/attachment.html>


More information about the swift-evolution mailing list