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

map

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

Description

Applies the given function to successive sublists of the argument lists and returns the first argument list. All of the lists should have the same length. This function is not the same as the standard Scheme map function. To get the behavior of the standard Scheme map function, use mapcar instead. This function is usually used for its side effects, not its return value (see mapc).

This function is not the same as the standard Scheme map function. To get the behavior of the standard Scheme map function, use mapcar instead.

Arguments

u_func

Function to apply to successive sublists. Must be a function that accepts lists as arguments.

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

No interesting side effect.

map( 'list '(1 2 3) '(9 8 7) )
=> (1 2 3)

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

map( '(lambda (x y) (print (append x y))) '(1 2 3) '(9 8 7) )
(1 2 3 9 8 7) (2 3 8 7) (3 7)
=> (1 2 3)

Related Topics

Flow Control Functions

apply

foreach

mapc

mapcar

mapcan

maplist


Return to top
 ⠀
X