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

mapc

mapc( 
u_func 
l_arg1 
[ l_arg2 ... ] 
) 
=> l_arg1

Description

Applies a function to successive elements of the argument lists and returns the first argument list. All of the lists should have the same length. mapc returns l_arg1.

mapc is primarily used with a u_func that has side effects, because the values returned by the u_func are not preserved. u_func must be an object acceptable as the first argument to apply and it must accept as many arguments as there are lists. It is first passed the car of all the lists given as arguments. The elements are passed in the order in which the lists are specified. The second elements are passed to u_func, and so on until the last element.

Arguments

u_func

Function to apply to argument lists.

l_arg1

Argument list.

l_arg2

Additional argument lists, which must be the same length as l_arg1.

Value Returned

l_arg1

The first argument list.

Examples

Prints three lists as a side effect and returns the list (1 2 3).

mapc( 'list '(1 2 3) '(9 8 7) ) => (1 2 3)
mapc( '(lambda (x y) (print (list x y))) '(1 2 3) '(9 8 7) )
(1 9) (2 8) (3 7)
=> (1 2 3)

Related Topics

Flow Control Functions

foreach

map

mapcar

mapcan

maplist


Return to top
 ⠀
X