Jens Mueller:

It's a special case of randomSample.

Maybe in theory, but I am not going to use randomSample to generate a random string. Your code is slow and bug-prone.


But you may argue that the use case occurs
that often that it should be added.

Right. (I even argue that in Phobos today there are functions that are much less commonly useful than a choice()).

Bye,
bearophile

Reply via email to