3 ms·
In that case, have shuffle() always return a new copy, and there is no in-place shuffle. I would consider this a good solution, assuming that the loss of an in-
by jdmichal 11y ago
In that case, have shuffle() always return a new copy, and there is no in-place shuffle. I would consider this a good solution, assuming that the loss of an in-place shuffle is acceptable. (This would basically be the .NET LINQ approach.)
- stickfigure 11y agoFor a really class act, check out Ceylon's collection classes. As an example, Set and SetMutator are separate interfaces; a MutableSet has both. The whole standard library is really well thought out WRT typesafe functional programming.