+, * These procedures return the sum or product of their arguments.

+, * These procedures return the sum or product of their arguments.

-, / With two or more arguments, these procedures return the difference or quotient of their arguments, associating to the left. With one argument, however, they return the additive or multiplicative inverse of their argument. It is an error if any argument of / other than the first is an exact zero. If the first argument is an exact zero, an implementation may return an exact zero unless one of the other arguments is a NaN.

=, <, >, <=, >= These procedures return #t if their arguments are (respectively): equal, monotonically increasing, monotonically decreasing, monotonically non-decreasing, or monotonically non-increasing, and #f otherwise. If any of the arguments are +nan.0, all the predicates return #f. They do not distinguish between inexact zero and inexact negative zero. These predicates are transitive. Note: While it is not an error to compare inexact numbers using these predicates, the results are unreliable because a small inaccuracy can affect the result; this is especially true of = and zero?. When in doubt, consult a numerical analyst.

(
<=?
[
comparator?
comparator
]
object1
object2
object3
...
)
⟹
boolean?

=?, <?, >?, <=?, >=? These procedures are analogous to the number, character, and string comparison predicates of Scheme. They allow the convenient use of comparators to handle variable data types.
These procedures apply the equality and ordering predicates of comparator to the objects as follows. If the specified relation returns #t for all objecti and objectj where n is the number of objects and 1 <= i < j <= n, then the procedures return #t, but otherwise #f. Because the relations are transitive, it suffices to compare each object with its successor. The order in which the values are compared is unspecified.

(
<?
[
comparator?
comparator
]
object1
object2
object3
...
)
⟹
boolean?

(
=?
[
comparator?
comparator
]
object1
object2
object3
...
)
⟹
boolean?

(
>=?
[
comparator?
comparator
]
object1
object2
object3
...
)
⟹
boolean?

(
>?
[
comparator?
comparator
]
object1
object2
object3
...
)
⟹
boolean?

The abs procedure returns the absolute value of its argument.

(
alist->hash-table
[
list?
alist
]
[
comparator?
comparator
]
arg
...
)
⟹
hash-table?
(
alist->hash-table
[
list?
alist
]
[
procedure?
equality-predicate
]
arg
...
)
⟹
hash-table?
(
alist->hash-table
[
list?
alist
]
[
procedure?
equality-predicate
]
[
procedure?
hash-function
]
arg
...
)
⟹
hash-table?

equality-predicate
⟹
(
λ
a
b
)
⟹
boolean?

hash-function
⟹
(
λ
obj
)
⟹
integer?

(lambda (key datum alist) (cons (cons key datum) alist)) Cons a new alist entry mapping key -> datum onto alist.

Make a fresh copy of alist. This means copying each pair that forms an association as well as the spine of the list.

(
alist-delete
key
[
list?
alist
]
)
⟹
list?
(
alist-delete
key
[
list?
alist
]
[
procedure?
=
]
)
⟹
list?

=
⟹
(
λ
a
b
)
⟹
*

alist-delete, alist-delete! alist-delete deletes all associations from alist with the given key, using key-comparison procedure =, which defaults to equal?. The dynamic order in which the various applications of = are made is not specified. Return values may share common tails with the alist argument. The alist is not disordered -- elements that appear in the result alist occur in the same order as they occur in the argument alist. The comparison procedure is used to compare the element keys ki of alist's entries to the key parameter in this way: (= key ki). Thus, one can reliably remove all entries of alist whose key is greater than five with (alist-delete 5 alist <). alist-delete! is the linear-update variant of alist-delete. It is allowed, but not required, to alter cons cells from the alist parameter to construct the result.

(
any
[
procedure?
pred
]
[
list?
clist1
]
[
list?
clist2
]
...
)
⟹
*

pred
⟹
(
λ
obj1
obj2
...
)
⟹
*

Applies the predicate across the lists, returning true if the predicate returns true on any application. If there are n list arguments clist1 ... clistn, then pred must be a procedure taking n arguments and returning a single value, interpreted as a boolean (that is, #f means false, and any other value means true). any applies pred to the first elements of the clisti parameters. If this application returns a true value, any immediately returns that value. Otherwise, it iterates, applying pred to the second elements of the clisti parameters, then the third, and so forth. The iteration stops when a true value is produced or one of the lists runs out of values; in the latter case, any returns #f. The application of pred to the last element of the lists is a tail call. Note the difference between find and any -- find returns the element that satisfied the predicate; any returns the true value that the predicate produced. Like every, any's name does not end with a question mark -- this is to indicate that it does not return a simple boolean (#t or #f), but a general value.

Returns a list consisting of the elements of the first list followed by the elements of the other list s. If there are no arguments, the empty list is returned. If there is exactly one argument, it is returned. Otherwise the resulting list is always newly allocated, except that it shares structure with the last argument. An improper list results if the last argument is not a proper list.

append, append! append returns a list consisting of the elements of list1 followed by the elements of the other list parameters. The resulting list is always newly allocated, except that it shares structure with the final listi argument. This last argument may be any value at all; an improper list results if it is not a proper list. All other arguments must be proper lists. append! is the "linear-update" variant of append -- it is allowed, but not required, to alter cons cells in the argument lists to construct the result list. The last argument is never altered; the result list shares structure with this parameter.

(
append-map
[
procedure?
proc
]
[
list?
list1
]
[
list?
list2
]
...
)
⟹
list?

proc
⟹
(
λ
obj1
obj2
...
)
⟹
list?

append-map, append-map! Equivalent to (apply append (map f clist1 clist2 ...)) and (apply append! (map f clist1 clist2 ...)). Map f over the elements of the lists, just as in the map function. However, the results of the applications are appended together to make the final result. append-map uses append to append the results together; append-map! uses append!. The dynamic order in which the various applications of f are made is not specified.

(
append-reverse
[
list?
rev-head
]
[
list?
tail
]
)
⟹
list?
(
append-reverse
[
list?
rev-head
]
tail
)
⟹
*

append-reverse, append-reverse! append-reverse returns (append (reverse rev-head) tail). It is provided because it is a common operation -- a common list-processing style calls for this exact operation to transfer values accumulated in reverse order onto the front of another list, and because the implementation is significantly more efficient than the simple composition it replaces. (But note that this pattern of iterative computation followed by a reverse can frequently be rewritten as a recursion, dispensing with the reverse and append-reverse steps, and shifting temporary, intermediate storage from the heap to the stack, which is typically a win for reasons of cache locality and eager storage reclamation.) append-reverse! is just the linear-update variant -- it is allowed, but not required, to alter rev-head's cons cells to construct the result.

(
apply
[
procedure?
proc
]
arg1
...
[
list?
args
]
)
⟹
*

The apply procedure calls proc with the elements of the list