pick seq &key :end :start :avoid :state [Function]

Returns a randomly chosen element from seq, which may be a list or array. Start is the lower selection bound and defaults to 0. End is the upper selection bound and defaults to the length of seq. If specified, avoid is an element to ignore. Use avoid to avoid direct reselection of an element. state is the random state to use and defaults to *cm-state*.

Example:

? (pick '(1 two 3 four 5))
3

? (pick "foobar" :start 1)
#\a

See Also:

between, pickl


Last Modified: 5-Mar-1998