February 15, 2009 Re: default random object? | ||||
|---|---|---|---|---|
| ||||
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
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply