<div dir="ltr">When Apple added GameplayKit to iOS, they added randomisation functions. Could that implementation be repeated in Swift Foundation?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 11, 2017 at 2:48 AM, Susan Cheng via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have an implementation for reference<br>
<a href="https://github.com/SusanDoggie/Doggie/blob/master/Sources/Doggie/Foundation/Random.swift" rel="noreferrer" target="_blank">https://github.com/<wbr>SusanDoggie/Doggie/blob/<wbr>master/Sources/Doggie/<wbr>Foundation/Random.swift</a><br>
<br>
It's easy to remind that what's the range of random floating point number<br>
<br>
Double.random(includeOne: true)<br>
Double.random(includeOne: false)<br>
<br>
2017-09-09 0:52 GMT+08:00 Alejandro Alonso via swift-evolution<br>
<<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> Hello swift evolution, I would like to propose a unified approach to<br>
> `random()` in Swift. I have a simple implementation here<br>
> <a href="https://gist.github.com/Azoy/5d294148c8b97d20b96ee64f434bb4f5" rel="noreferrer" target="_blank">https://gist.github.com/Azoy/<wbr>5d294148c8b97d20b96ee64f434bb4<wbr>f5</a>. This<br>
> implementation is a simple wrapper over existing random functions so<br>
> existing code bases will not be affected. Also, this approach introduces a<br>
> new random feature for Linux users that give them access to upper bounds, as<br>
> well as a lower bound for both Glibc and Darwin users. This change would be<br>
> implemented within Foundation.<br>
><br>
> I believe this simple change could have a very positive impact on new<br>
> developers learning Swift and experienced developers being able to write<br>
> single random declarations.<br>
><br>
> I’d like to hear about your ideas on this proposal, or any implementation<br>
> changes if need be.<br>
><br>
> - Alejando<br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
><br>
______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
</div></div></blockquote></div><br></div>