Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

mapcar

mapcar( 
u_func 
l_arg1 
[ l_arg2 ... ] 
) 
=> l_result

Description

Applies a function to successive elements of the argument lists and returns the list of the corresponding results.

The values returned from successive calls to u_func are put into a list using the list function. If the argument lists are of different lengths, the mapcar function iterates till the end of the shortest list.

Arguments

u_func

Function to be applied to argument lists. The result of each call to u_func can be of any data type.

l_arg1

Argument list.

l_arg2

Additional argument lists.

Value Returned

l_result

A list of results from applying u_func to successive elements of the argument list.

Examples

mapcar( 'plus '(1 2 3) '(9 8 7) )
=> (10 10 10)
mapcar( 'plus '(1 2 3 4) '(4 5) '(1 2 3 4 5 6) '(1 2 3))
=> (7 11)
mapcar( 'list '(a b c) '(1 2 3) '(x y z) )
=> ((a 1 x) (b 2 y) (c 3 z))
mapcar( lambda( (x) plus( x 1 )) '(2 4 6) )
=> (3 5 7)

Related Topics

Flow Control Functions

map

mapc

mapcan

mapcon

maplist

nconc


Return to top
 ⠀
X