https://www.cnblogs.com/yeungchie/
map
map(
lambda(( a b )
println( list( a b ))
)
list( 1 2 3 )
list( 4 5 6 )
)
; ((1 2 3) (4 5 6))
; ((2 3) (5 6))
; ((3) (6))
; => (1 2 3)
mapc
mapc(
lambda(( a b )
println( list( a b ))
)
list( 1 2 3 )
list( 4 5 6 )
)
; (1 4)
; (2 5)
; (3 6)
; => (1 2 3)
mapcan
mapcan(
lambda(( a b )
println( list( a b ))
list( a + b )
)
list( 1 2 3 )
list( 4 5 6 )
)
; (1 4)
; (2 5)
; (3 6)
; => (5 7 9)
mapcar
mapcan(
lambda(( a b )
println( list( a b ))
a + b
)
list( 1 2 3 )
list( 4 5 6 )
)
; (1 4)
; (2 5)
; (3 6)
; => (5 7 9)
mapcon
mapcon(
lambda(( a b )
println( list( a b ))
list(a b)
)
list( 1 2 3 )
list( 4 5 6 )
)
; ((1 2 3) (4 5 6))
; ((2 3) (5 6))
; ((3) (6))
; => ((1 2 3) (4 5 6) (2 3) (5 6) (3) (6))
maplist
maplist(
lambda(( a b )
println( list( a b ))
list(a b)
)
list( 1 2 3 )
list( 4 5 6 )
)
; ((1 2 3) (4 5 6))
; ((2 3) (5 6))
; ((3) (6))
; => (((1 2 3) (4 5 6)) ((2 3) (5 6)) ((3) (6)))
mapinto
mapinto(
list( 0 0 0 0 0 )
lambda(( a b )
println( list( a b ))
a + b
)
list( 1 2 3 )
list( 4 5 6 )
)
; (1 4)
; (2 5)
; (3 6)
; => (5 7 9 0 0)