[racket-dev] Add `set-get-one' and `set-get-one/rest' to set.rkt

From: Daniel King (danking at ccs.neu.edu)
Date: Thu Dec 15 14:57:59 EST 2011

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.

This was discussed previously here:

Dan King
College of Computer and Information Science
Northeastern University

Posted on the dev mailing list.