Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

maplist

maplist

type: function (subr) 
location: built-in
source file: xllist.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(maplist <function> <list1> [ <list2> ... ] )
        <function>      -       a function definition (like a LAMBDA) 
                                or a function name
        <listN>         -       a list or list expression

DESCRIPTION

MAPLIST applies the <function> to the successive CDRs of each of the lists <listN>. Each of the lists supplies one of the arguments to <function>. The MAPLIST function returns a list that is constructed from the results of the <function> applications. If the lists are of different lengths, the shortest list will determine the number of applications of <function>.

EXAMPLES

(maplist 'print '(a b c))               ; prints (A B C)
                                        ;        (B C)
                                        ;        (C)
                                        ; returns ((A B C) (B C) (C))
                                        ;
(maplist (lambda (x y)                  ; append the lists into one     
             (length (append x y)))     ;   list and find it's length
         '(a b c d) '(1 2 3 4))         ; returns (8 6 4 2)

NOTE: The use of the <function> will work properly when it is a quoted symbol (which is the name of the function), an unquoted symbol (whose value is a function) or a closure object (like a LAMBDA).


Go to the first, previous, next, last section, table of contents.