Next: srfi sets-and-bags subsets, Previous: srfi sets-and-bags map, Up: srfi sets-and-bags [Index]
Return a newly allocated set or bag containing the elements of set or bag and using the same comparator.
Return a newly allocated list containing the members of set or bag in unspecified order.
As Vicare extension, if the optional argument compar is present:
#f
: the function behaves as if compar
is not present.
#t
: the resulting list is sorted using the
standard list-sort
and the comparison procedure from the
set or bag comparator, so that the lesser elements come
first.
list-sort
and compar as comparison predicate.
Usage examples:
(import (vicare) (srfi :113) (srfi :114)) (list-sort < (set->list (set fixnum-comparator 1 2 3))) ⇒ (1 2 3) (set->list (set fixnum-comparator 1 2 3) #t) ⇒ (1 2 3) (set->list (set fixnum-comparator 1 2 3) fx<?) ⇒ (1 2 3) (set->list (set fixnum-comparator 1 2 3) fx>?) ⇒ (3 2 1) ;;; (list-sort < (bag->list (bag fixnum-comparator 1 2 2 3))) ⇒ (1 2 2 3) (bag->list (bag fixnum-comparator 1 2 2 3) #t) ⇒ (1 2 2 3) (bag->list (bag fixnum-comparator 1 2 2 3) fx<?) ⇒ (1 2 2 3) (bag->list (bag fixnum-comparator 1 2 2 3) fx>?) ⇒ (3 2 2 1)
Return a newly allocated set or bag, created as if by set
or
bag
using comparator, that contains the elements of
list. When building a set: duplicate elements (in the sense of
the equality predicate) are omitted.
Return a set or bag that contains the elements of both set or bag and list, using the comparator of set or bag. The functions are permitted to mutate set or bag and return it. When building a set: duplicate elements (in the sense of the equality predicate) are omitted.
Next: srfi sets-and-bags subsets, Previous: srfi sets-and-bags map, Up: srfi sets-and-bags [Index]