[racket-dev] Add `set-get-one' and `set-get-one/rest' to set.rkt
The procedure `set-get-one/rest' returns a random element from the set and a new
set with that element removed. It is used for iterating over a set It
is not guaranteed
to return the same element if it is called twice on the original set.
The procedure `set-get-one' only returns a random element from the set. This can
be used if the programmer simply needs some element from the set and is not
iterating over the set.
I've implemented these and initiated a pull request.
https://github.com/plt/racket/pull/65
This was discussed previously here:
http://lists.racket-lang.org/users/archive/2011-September/047919.html
--
Dan King
College of Computer and Information Science
Northeastern University