> On Nov 30, 2017, at 3:52 PM, Dave DeLong <sw...@davedelong.com> wrote:
>
> What is the useful distinction between generating a random value, and
> choosing a random element from a collection of all possible values?
I don’t have to generate (or keep in memory) that collection.
I gave an example before of an easy to add API for random colors which allow
their saturation, lightness, and alpha to be fixed. I use something very
similar all the time in some graphics code I have (varying only the hue or
saturation). I also do the same with Sizes and CGVectors. How would you
represent that as a collection to choose an element from?
Also, for most of my use cases, I *need* to be able to plug in a repeatably
random source… otherwise pixels will start jumping around the screen when
people resize things.
Thanks,
Jon
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution