7.5.1 GMap Base Argument Types

These could have been called “generators”.

GMap arg type: constant value

Yields value on every iteration.

GMap arg type: list list

Yields successive elements of list.

GMap arg type: improper-list list

Yields the successive elements of ‘list‘, which may be improper; any non-cons tail terminates the iteration.

GMap arg type: alist alist

Yields, as two values, the successive pairs of alist.

GMap arg type: plist plist

Yields, as two values, the successive pairs of elements of plist; that is, there is one iteration for each two elements.

GMap arg type: hash-table table

Yields, as two values, the successive pairs of table. (Warning: the ordering of pairs is Lisp-implementation-dependent and should not be relied on.)

GMap arg type: tails list

Yields the successive tails (cdrs) of list, starting with list itself, which may be improper.

GMap arg type: index &optional start stop &key incr (fixnums? t)

Yields integers in the interval [start, stop) if incr (which defaults to 1) is positive; or in the interval [stop, start) if incr is negative. Specifically, in the upward case, the values begin with start and increase by incr until >= stop; in the downward case, the values begin with start - incr and decrease by incr until < stop. All values are assumed to be fixnums unless fixnums? is a literal nil. stop can be omitted or a literal nil to indicate an unbounded sequence. start can be omitted to start at 0.

GMap arg type: index-inc start stop &key incr (fixnums? t)

("Index, INClusive") Yields integers in the interval [start, stop]. Specifically, in the upward case (incr > 0), the values begin with start and increase by incr until > stop; in the downward case, the values begin with start and decrease by incr until < stop. All values are assumed to be fixnums unless fixnums? is a literal nil. stop can be a literal nil to indicate an unbounded sequence.

GMap arg type: exp initial-value base

Yields an exponential sequence whose first value is initial-value, and whose value is multiplied by base on each iteration.

GMap arg type: vector vec &key start stop incr

Yields elements of vector vec. start and stop may be supplied to select a subsequence of vec; incr may be supplied (it must be positive) to select every second element etc. For performance, you may prefer simple-vector.

GMap arg type: simple-vector vec &key start stop incr

Yields elements of vector vec, which is assumed to be simple, and whose size is assumed to be a fixnum. start and stop may be supplied to select a subsequence of vec; incr may be supplied (it must be positive) to select every second element etc.

GMap arg type: string str &key start stop incr

Yields elements of string str. start and stop may be supplied to select a subsequence of vec; incr may be supplied (it must be positive) to select every second element etc. For performance, you may prefer simple-string.

GMap arg type: simple-string str &key start stop incr

Yields elements of string str, which is assumed to be simple, and whose size is assumed to be a fixnum. start and stop may be supplied to select a subsequence of str; incr may be supplied (it must be positive) to select every second element etc.

GMap arg type: array ary &key start stop incr

Yields elements of array ary, which may be multidimensional and/or specialized. Access is via row-major-aref, so the elements are yielded in row-major order. start and stop, which are row-major indices, may be supplied to select a subsequence, and incr to skip one or more elements at each step.

GMap arg type: file-chars pathname &key element-type external-format

Yields the characters of the file named by pathname. element-type and external-format, if supplied, are passed to open.

GMap arg type: file-lines pathname &key skip-initial external-format

Yields the lines of the file named by pathname. If skip-initial is given, it is the number of initial lines to skip. external-format, if supplied, is passed to open.