(
:-dispatch-set!
[
procedure?
d
]
)

(
:dispatched
⟨
var
⟩
⟨
dispatch
⟩
⟨
arg1
⟩
⟨
arg2
⟩
...
)
⟹
generator-macro
(
:dispatched
⟨
var1
⟩
(
index
⟨
var2
⟩
)
⟨
dispatch
⟩
⟨
arg1
⟩
⟨
arg2
⟩
...
)
⟹
generator-macro

dispatch
⟹
procedure?

(
:port
⟨
var
⟩
⟨
port
⟩
)
⟹
generator-macro
(
:port
⟨
var1
⟩
(
index
⟨
var2
⟩
)
⟨
port
⟩
)
⟹
generator-macro
(
:port
⟨
var
⟩
⟨
port
⟩
⟨
read-proc
⟩
)
⟹
generator-macro
(
:port
⟨
var1
⟩
(
index
⟨
var2
⟩
)
⟨
port
⟩
⟨
read-proc
⟩
)
⟹
generator-macro

port
⟹
input-port?

read-proc
⟹
procedure?

(
</<=?
)
⟹
procedure?
(
</<=?
[
procedure?
compare
]
)
⟹
procedure?
(
</<=?
x
y
z
)
⟹
boolean?
(
</<=?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
</<?
)
⟹
procedure?
(
</<?
[
procedure?
compare
]
)
⟹
procedure?
(
</<?
x
y
z
)
⟹
boolean?
(
</<?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
<=/<=?
)
⟹
procedure?
(
<=/<=?
[
procedure?
compare
]
)
⟹
procedure?
(
<=/<=?
x
y
z
)
⟹
boolean?
(
<=/<=?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
<=/<?
)
⟹
procedure?
(
<=/<?
[
procedure?
compare
]
)
⟹
procedure?
(
<=/<?
x
y
z
)
⟹
boolean?
(
<=/<?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
<=?
)
⟹
procedure?
(
<=?
[
procedure?
compare
]
)
⟹
procedure?
(
<=?
x
y
)
⟹
boolean?
(
<=?
[
procedure?
compare
]
x
y
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
<?
)
⟹
procedure?
(
<?
[
procedure?
compare
]
)
⟹
procedure?
(
<?
x
y
)
⟹
boolean?
(
<?
[
procedure?
compare
]
x
y
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
=?
)
⟹
procedure?
(
=?
[
procedure?
compare
]
)
⟹
procedure?
(
=?
x
y
)
⟹
boolean?
(
=?
[
procedure?
compare
]
x
y
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>/>=?
)
⟹
procedure?
(
>/>=?
[
procedure?
compare
]
)
⟹
procedure?
(
>/>=?
x
y
z
)
⟹
boolean?
(
>/>=?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>/>?
)
⟹
procedure?
(
>/>?
[
procedure?
compare
]
)
⟹
procedure?
(
>/>?
x
y
z
)
⟹
boolean?
(
>/>?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>=/>=?
)
⟹
procedure?
(
>=/>=?
[
procedure?
compare
]
)
⟹
procedure?
(
>=/>=?
x
y
z
)
⟹
boolean?
(
>=/>=?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>=/>?
)
⟹
procedure?
(
>=/>?
[
procedure?
compare
]
)
⟹
procedure?
(
>=/>?
x
y
z
)
⟹
boolean?
(
>=/>?
[
procedure?
compare
]
x
y
z
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>=?
)
⟹
procedure?
(
>=?
[
procedure?
compare
]
)
⟹
procedure?
(
>=?
x
y
)
⟹
boolean?
(
>=?
[
procedure?
compare
]
x
y
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
>?
)
⟹
procedure?
(
>?
[
procedure?
compare
]
)
⟹
procedure?
(
>?
x
y
)
⟹
boolean?
(
>?
[
procedure?
compare
]
x
y
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
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.

(
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.

(
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-map!
[
procedure?
proc
]
[
list?
list1
]
[
list?
list2
]
...
)
⟹
list?

proc
⟹
(
λ
obj1
objs2
...
)
⟹
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.

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

(
args-fold
[
list?
args
]
[
list?
options
]
[
procedure?
unrecognized-option-proc
]
[
procedure?
operand-proc
]
seed
...
)
⟹
(
values
*
...
)

unrecognized-option-proc
⟹
(
λ
[
option
option
]
[
string?
/
char?
name
]
[
string?
arg
]
seed
...
)
⟹
(
values
*
...
)

operand-proc
⟹
(
λ
[
string?
operand
]
seed
...
)
⟹
(
values
*
...
)

(
assoc
obj
[
list?
alist
]
)
⟹
(
or
list?
#f
)
(
assoc
obj
[
list?
alist
]
[
procedure?
=
]
)
⟹
(
or
pair?
#f
)

=
⟹
(
λ
a
b
)
⟹
*

assoc, assq, assv alist must be an association list -- a list of pairs. These procedures find the first pair in alist whose car field is key, and returns that pair. If no pair in alist has key as its car, then #f is returned. assq uses eq? to compare key with the car fields of the pairs in alist, while assv uses eqv? and assoc uses equal?. assoc is extended from its R5RS definition to allow the client to pass in an optional equality procedure = used to compare keys. The comparison procedure is used to compare the elements ei of list to the key parameter in this way: (= key (car ei)) ; list is (E1 ... En). That is, the first argument is always key, and the second argument is one of the list elements. Thus one can reliably find the first entry of alist whose key is greater than five with (assoc 5 alist <). Note that fully general alist searching may be performed with the find-tail and find procedures

(
break
[
procedure?
pred
]
[
list?
list
]
)
⟹
(
values
list?
list?
)
(
break
[
procedure?
pred
]
[
circular-list?
list
]
)
⟹
(
values
list?
circular-list?
)

pred
⟹
(
λ
obj
)
⟹
*

span, span!, break, break! Span splits the list into the longest initial prefix whose elements all satisfy pred, and the remaining tail. Break inverts the sense of the predicate: the tail commences with the first element of the input list that satisfies the predicate. In other words: span finds the intial span of elements satisfying pred, and break breaks the list at the first element satisfying pred. Span is equivalent to (values (take-while pred clist) (drop-while pred clist)). Span! and break! are the linear-update variants. They are allowed, but not required, to alter the argument list to produce the result.

(
break!
[
procedure?
pred
]
[
list?
list
]
)
⟹
(
values
list?
list?
)

pred
⟹
(
λ
obj
)
⟹
*

span, span!, break, break! Span splits the list into the longest initial prefix whose elements all satisfy pred, and the remaining tail. Break inverts the sense of the predicate: the tail commences with the first element of the input list that satisfies the predicate. In other words: span finds the intial span of elements satisfying pred, and break breaks the list at the first element satisfying pred. Span is equivalent to (values (take-while pred clist) (drop-while pred clist)). Span! and break! are the linear-update variants. They are allowed, but not required, to alter the argument list to produce the result.

(
call-with-current-continuation
[
procedure?
proc
]
)
⟹
*

proc
⟹
(
λ
[
procedure?
k
]
)
⟹
*

(
call-with-input-file
[
string?
string
]
[
procedure?
proc
]
)
⟹
*

proc
⟹
(
λ
[
input-port?
port
]
)
⟹
*

(
call-with-output-file
[
string?
string
]
[
procedure?
proc
]
)
⟹
*

proc
⟹
(
λ
[
output-port?
port
]
)
⟹
*

(
call-with-values
[
procedure?
producer
]
[
procedure?
consumer
]
)
⟹
*

producer
⟹
(
λ
)
⟹
*

consumer
⟹
(
λ
obj
...
)
⟹
*

(
chain<=?
[
procedure?
compare
]
x1
...
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
chain<?
[
procedure?
compare
]
x1
...
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
chain=?
[
procedure?
compare
]
x1
...
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
chain>=?
[
procedure?
compare
]
x1
...
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
chain>?
[
procedure?
compare
]
x1
...
)
⟹
boolean?

compare
⟹
(
λ
x
y
)
⟹
integer?

(
char-set-any
[
procedure?
pred
]
[
char-set?
cs
]
)
⟹
boolean?

pred
⟹
(
λ
[
char?
c
]
)
⟹
boolean?

(
char-set-count
[
procedure?
pred
]
[
char-set?
cs
]
)
⟹
integer?

pred
⟹
(
λ
[
char?
c
]
)
⟹
boolean?

(
char-set-every
[
procedure?
pred
]
[
char-set?
cs
]
)
⟹
boolean?

pred
⟹
(
λ
[
char?
c
]
)
⟹
boolean?

(
char-set-filter
[
procedure?
pred
]
[
char-set?
cs
]
)
⟹
char-set?
(
char-set-filter
[
procedure?
pred
]
[
char-set?
cs
]
[
char-set?
base-cs
]
)
⟹
char-set?

pred
⟹
(
λ
[
char?
c
]
)
⟹
boolean?

(
char-set-filter!
[
procedure?
pred
]
[
char-set?
cs
]
[
char-set?
base-cs
]
)
⟹
char-set?

pred
⟹
(
λ
[
char?
c
]
)
⟹
boolean?