add `set-get-one' and `set-get-one/rest' #65

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@danking

The procedure `set-get-one/rest' returns a random element from the set and a new
set with that element removed. 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.

This was discussed here:
http://lists.racket-lang.org/users/archive/2011-September/047919.html

@danking danking add `set-get-one' and `set-get-one/rest'
The procedure `set-get-one/rest' returns a random element from the set and a new
set with that element removed. 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.

This was discussed here:
http://lists.racket-lang.org/users/archive/2011-September/047919.html
6fe5ba3
@stamourv

set-first and set-rest, added in ac5965a, make this redundant. @elibarzilay, you can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment