<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Nov 28, 2017, at 11:10 PM, Thorsten Seitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">Shouldn't it be</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; random.choose(<b class="">from:</b>&nbsp;1...6)</div><div class=""><br class=""></div><div class="">etc.?</div><div class=""><br class=""></div><div class="">-Thorsten&nbsp;</div></div></div></blockquote><div><br class=""></div><div>Doesn't `choose` usually take two arguments, the `count` to choose (presumably defaulting to 1) and the collection to choose `from`?</div><div><br class=""></div><div>-- E</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class="">Am 28.11.2017 um 00:20 schrieb Martin Waitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><span class="">Hello,</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">Maybe we call the default RNG instance `random`, and then give the `random(in:)` methods another name, like `choose(in:)`?</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""></span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let diceRoll = random.choose(in: 1...6)</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let card = random.choose(in: deck)</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let isHeads = random.choose(in: [true, false])</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let probability = random.choose(in: 0.0...1.0)</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let diceRoll = rng.choose(in: 1...6)</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let card = rng.choose(in: deck)</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let isHeads = rng.choose(in: [true, false])</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""> &nbsp; &nbsp;let probability = rng.choose(in: 0.0...1.0)</span><br class=""></blockquote><span class=""></span><br class=""><span class="">I like this design a lot. After all, `random` is not a property of some type or instance, but we want to generate a new random element within some range/based on some given set.</span><br class=""><span class="">Modeling that as methods of the RNG seems to be much more natural.</span><br class=""><span class=""></span><br class=""><span class="">-- </span><br class=""><span class="">Martin</span><br class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>