@code{(require 'srfi-1)}
@ftindex srfi-1

@noindent
Implements the @dfn{SRFI-1} @dfn{list-processing library} as described
@cindex SRFI-1
@cindex list-processing library
at @url{http://srfi.schemers.org/srfi-1/srfi-1.html}

@subheading Constructors


@defun xcons d a

 @code{(define (xcons d a) (cons a d))}.
@end defun


@defun list-tabulate len proc

 Returns a list of length @var{len}.  Element @var{i} is
@code{(@var{proc} @var{i})} for 0 <= @var{i} < @var{len}.
@end defun


@defun cons* obj1 obj2

@end defun


@defun list-copy flist

@end defun


@defun iota count start step


@defunx iota count start

@defunx iota count
Returns a list of @var{count} numbers: (@var{start}, @var{start}+@var{step}, @dots{},  @var{start}+(@var{count}-1)*@var{step}).
@end defun


@defun circular-list obj1 obj2 @dots{}

Returns a circular list of @var{obj1}, @var{obj2}, @dots{}.
@end defun

@subheading Predicates


@defun proper-list? obj

@end defun


@defun circular-list? x

@end defun


@defun dotted-list? obj

@end defun


@defun null-list? obj

@end defun


@defun not-pair? obj

@end defun


@defun list= =pred list @dots{}

@end defun

@subheading Selectors


@defun first pair

@end defun


@defun second pair

@end defun


@defun third pair

@end defun


@defun fourth pair

@end defun


@defun fifth pair
@defunx sixth pair
@defunx seventh pair
@defunx eighth pair
@defunx ninth pair
@defunx tenth pair

@end defun


@defun car+cdr pair

@end defun


@defun drop lst k
@defunx take lst k
@defunx take! lst k

@end defun


@defun take-right lst k

@end defun


@defun drop-right lst k

@end defun


@deffn {Procedure} drop-right! lst k

@end deffn


@defun split-at lst k
@defunx split-at! lst k

@end defun


@defun last lst k @dots{}

@end defun

@subheading Miscellaneous


@defun length+ clist

@end defun


@defun concatenate lists
@defunx concatenate! lists

@end defun


@deffn {Procedure} reverse! lst

@end deffn


@defun append-reverse rev-head tail
@defunx append-reverse! rev-head tail

@end defun


@defun zip list1 list2 @dots{}

@end defun


@defun unzip1 lst
@defunx unzip2 lst
@defunx unzip3 lst
@defunx unzip4 lst
@defunx unzip5 lst

@end defun


@defun count pred list1 list2 @dots{}

@end defun

@subheading Fold and Unfold


@defun fold kons knil clist1 clist2 @dots{}

@end defun


@defun fold-right kons knil clist1 clist2 @dots{}

@end defun


@defun pair-fold kons knil clist1 clist2 @dots{}

@end defun


@defun pair-fold-right kons knil clist1 clist2 @dots{}

@end defun


@defun reduce arg @dots{}

@end defun

      
@deffn {Procedure} map! f clist1 clist2 @dots{}

@end deffn


@defun pair-for-each f clist1 clist2 @dots{}

@end defun

@subheading Filtering and Partitioning


@defun filter pred list

@end defun


@deffn {Procedure} filter! pred list

@end deffn


@defun partition pred list

@end defun


@defun remove pred list

@end defun


@deffn {Procedure} partition! pred list

@end deffn


@deffn {Procedure} remove! pred list

@end deffn

@subheading Searching


@defun find pred clist

@end defun


@defun find-tail pred clist

@end defun


@defun span pred list

@end defun


@deffn {Procedure} span! pred list

@end deffn


@defun break pred list

@end defun


@deffn {Procedure} break! pred list

@end deffn


@defun any pred clist1 clist2 @dots{}

@end defun


@defun list-index pred clist1 clist2 @dots{}

@end defun


@defun member obj list =


@defunx member obj list
@end defun

@subheading Deleting


@defun delete-duplicates x list =


@defunx delete-duplicates x list
@end defun


@deffn {Procedure} delete-duplicates! x list =


@deffnx {Procedure} delete-duplicates! x list
@end deffn

@subheading Association lists


@defun assoc obj alist pred


@defunx assoc obj alist
@end defun


@defun alist-cons key datum alist

@end defun


@defun alist-copy alist

@end defun


@defun alist-delete key alist =


@defunx alist-delete key alist
@end defun


@deffn {Procedure} alist-delete! key alist =


@deffnx {Procedure} alist-delete! key alist
@end deffn

@subheading Set operations


@defun lset<= = list1 @dots{}

Determine if a  transitive subset relation exists between the lists @var{list1}
@dots{}, using @var{=} to determine equality of list members.
@end defun


@defun lset= = list1 list2 @dots{}

@end defun


@defun lset-adjoin list elt1 @dots{}

@end defun


@defun lset-union = list1 @dots{}

@end defun


@defun lset-intersection = list1 list2 @dots{}

@end defun


@defun lset-difference = list1 list2 @dots{}

@end defun


@defun lset-xor = list1 @dots{}

@end defun


@defun lset-diff+intersection = list1 list2 @dots{}

@end defun

@noindent
These are linear-update variants.  They are allowed, but not
required, to use the cons cells in their first list parameter to
construct their answer.  @code{lset-union!} is permitted to recycle
cons cells from any of its list arguments.


@deffn {Procedure} lset-intersection! = list1 list2 @dots{}

@end deffn


@deffn {Procedure} lset-difference! = list1 list2 @dots{}

@end deffn


@deffn {Procedure} lset-union! = list1 @dots{}

@end deffn


@deffn {Procedure} lset-xor! = list1 @dots{}

@end deffn


@deffn {Procedure} lset-diff+intersection! = list1 list2 @dots{}

@end deffn

