Search

( any?-ec qualifier ... test ) boolean?
generator generator-macro
qualifier⟩:= 
generator ( if test ) ( not test ) ( and test ... ) ( or test ... ) ( begin command ... expression ) ( nested qualifier ... )
( append [ list? list ] ... ) list? ( append [ list? list ] ... obj ) *
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! [ list? list ] ... ) list? ( append! [ list? list ] ... obj ) *
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-ec qualifier ... expression ) list?
generator generator-macro
expression list?
qualifier⟩:= 
generator ( if test ) ( not test ) ( and test ... ) ( or test ... ) ( begin command ... expression ) ( nested qualifier ... )
( 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.
( 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.
( 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.
( 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
( assq obj [ list? alist ] ) ( or pair? #f )
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
( assume obj message ) *
( assv obj [ list? alist ] ) ( or pair? #f )
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