> On 08 Jan 2018, at 21:02, Nate Cook via swift-evolution 
> <[email protected]> wrote:
> 
> I created a playground to explore this question, starting with a minimal 
> subset of the proposal’s additions and building from there. The attached 
> playground demonstrates what’s possible with this subset on the first page, 
> then uses subsequent pages to explore how the main random facilities of the 
> C++ STL work under this model. (In my opinion, they work pretty well!)
> 
> The subset in the playground has three main differences from the proposal:
>  - It doesn't include a Randomizable protocol or a random property on numeric 
> types.
>  - It doesn't include the static random(in:) methods on numeric types, either.
>  - The RandomNumberGenerator protocol doesn't have an associated type. 
> Instead, it requires all conforming types to produce UInt64 values.
> 
> I’ve tried to include a bit of real-world usage in the playground to 
> demonstrate what writing code would look like with these additions. Please 
> take a look!
> 
> Nate


+1 to this design

Just my 2 cents but this looks very simple and easy to use due to being very 
consistent. I also like that Randomizable was dropped as I feel it doesn’t hold 
its weight.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to