default random object?

bearophile bearophileHUGS at lycos.com
Sun Feb 15 04:31:37 PST 2009


Don:
> arr[random(0..arr.length)]
> is likely to be an _extremely_ common usage pattern. That argues very 
> strongly for "[)".

For that there's choice():

choice(arr)

Bye,
bearophile



More information about the Digitalmars-d mailing list