7.5.3 GMap FSet Argument Types

Many of these come in both generic (set, bag, etc.) and implementation-specific (ch-set, wb-set, etc.) flavors. In the past, there were performance reasons to prefer the specific ones when the implementation were known, but that is mostly no longer the case. The one situation in which you might notice a difference is when doing parallel iteration over two or more collections; even then, the difference will be small. So I recommend sticking with the generic ones; I have documented the specific ones here just for completeness.

GMap arg type: sequence seq

Yields the elements of seq, which can be of any CL sequence type as well as an FSet seq, or a set or bag as well — any type for which iterator has a method.

GMap arg type: iterator it

Yields the values returned by it, which must be an FSet stateful iterator.

GMap arg type: fun-sequence  &key from-end?

Yields the elements of fun-iterable, which can be an FSet seq, set, or bag. If :from-end? is true, iterates in reverse order. (Uses a functional iterator. There’s no reason to use this unless you want the from-end? behavior.)

GMap arg type: set s
GMap arg type: ch-set s
GMap arg type: wb-set s

Yields the elements of s.

GMap arg type: fun-set s &key from-end?

Yields the elements of s. (Uses a functional iterator. There’s no reason to use this unless you want the from-end? behavior.)

GMap arg type: map m
GMap arg type: ch-map m
GMap arg type: wb-map m

Yields each pair of m as two values.

GMap arg type: fun-map m &key from-end?

Yields the pairs of m as two values. (Uses a functional iterator. There’s no reason to use this unless you want the from-end? behavior.)

GMap arg type: bag b
GMap arg type: ch-bag b
GMap arg type: wb-bag b

Yields each element of b repeatedly, as many times as its multiplicity.

GMap arg type: bag-pairs b
GMap arg type: ch-bag-pairs b
GMap arg type: wb-bag-pairs b

Yields each element of b and its multiplicity as two values.

GMap arg type: seq  &key start end from-end?
GMap arg type: wb-seq  &key start end from-end?

Yields the elements of seq. The keyword parameters start and end can be supplied to restrict the range of the iteration; start is inclusive and defaults to 0, while end is exclusive and defaults to the size of the seq. If from-end? is true, the elements will be yielded in reverse order.

GMap arg type: tuple tpl
GMap arg type: dyn-tuple tpl

Yields each pair of tpl, as two values.

GMap arg type: replay-set s
GMap arg type: ch-replay-set s
GMap arg type: wb-replay-set s

Yields the elements of s. As always, the iteration is in replay order.

GMap arg type: replay-map m
GMap arg type: ch-replay-map m
GMap arg type: wb-replay-map m

Yields the pairs of m as two values. As always, the iteration is in replay order.

GMap arg type: 2-relation r
GMap arg type: ch-2-relation r
GMap arg type: wb-2-relation r

Yields each pair of r as two values.