

                                                                     mapping

    MACRO
MAPPING ({({VAR | ({VAR}*)} VALUE)}*) {DECLARATION}* {FORM}*        [Macro]

    Package
    series

    DESCRIPTION

The macro mapping makes it easy to specify uses of map-fn where TYPE is T
and the function a literal LAMBDA.  The syntax of mapping is analogous to
that of LET.  The binding list specifies zero or more variables that are
bound in parallel to successive values of series.  The VALUE part of each
pair is an expression that must produce a series.  The DECLARATIONS and
FORMS are treated as the body of a LAMBDA expression that is mapped over
the series values.  A series of the first values returned by this LAMBDA
expression is returned as the result of MAPPING.

(MAPPING ((X R) (Y S)) ...) == (MAP-FN T #'(LAMBDA (X Y) ...) R S) 
(MAPPING ((X (SCAN '(2 -2 3)))) 
  (EXPT (ABS X) 3)) => #Z(8 8 27)

The form MAPPING supports a special syntax that facilitates the use of
series functions returning multiple values.  Instead of being a single
variable, the variable part of a var-value-pair can be a list of variables.
This list is treated the same way as the first argument to
MULTIPLE-VALUE-BIND and can be used to access the elements of multiple
series returned by a series function.

(MAPPING (((I V) (SCAN-PLIST '(A 1 B 2)))) 
  (LIST I V)) 
 => #Z((A 1) (B 2))


     SEE ALSO
     about-series
     about-generators
     map-fn iterate

;Copyright 1989 by the Massachusetts Institute of Technology,
;Cambridge, Massachusetts.

;Permission to use, copy, modify, and distribute this software and its
;documentation for any purpose and without fee is hereby granted,
;provided that this copyright and permission notice appear in all
;copies and supporting documentation, and that the name of M.I.T. not
;be used in advertising or publicity pertaining to distribution of the
;software without specific, written prior permission. M.I.T. makes no
;representations about the suitability of this software for any
;purpose.  It is provided "as is" without express or implied warranty.

;    M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
;    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
;    M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
;    ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
;    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
;    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
;    SOFTWARE.



