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

mapinto

mapinto( 
l_resultSequence 
g_function 
({l_sequences}*)
) 
=> l_resultSequence

Description

Applies g_function to the elements of l_sequences and destructively modifies the l_resultSequence. The first argument is a sequence that receives the results of the mapping. If l_resultSequence and the other argument sequences are not all of the same length, the mapping stops when the shortest of l_resultSequence or l_sequences is exhausted.

If l_resultSequence is longer than l_sequences, extra elements at the end of l_resultSequence are unchanged.

If you specify nil as the l_resultSequence, no mapping is performed since nil is a sequence of length zero.

Arguments

l_resultSequence

A sequence that receives the results of the mapping.

g_function

Function (symbol or funobj) that takes as many arguments as there are sequences.

l_sequences

Several lists. Each element of these lists is used as an argument of g_function.

Value Returned

l_resultSequence

Updated first argument list.

Examples

mapinto ('(1 2 3 4) 'plus )
=>(1 2 3 4)
mapinto (' (1 2 3 4) 'plus ())
=>(1 2 3 4)
a = '(1 2 3 4 5)
mapinto ( a 'plus '(1 1 1) '(1 1))

=>(2 2 3 4 5)

Related Topics

Flow Control Functions


Return to top
 ⠀
X