Hi,
(mapcar '(lambda (x) (list (car x)(cadar x)) (list a b c)))
First they're 2 mistakes in this expression cadar instead of cadr and a misplaced parent.
Should have been:
(mapcar '(lambda (x) (list (car x) (cadr x))) (list a b c))
But this expression will return a 2d points list but never change a, b, c values
If you want to change the variables values you can write:
with mapcar and 2lists
(mapcar
'(lambda (v x) (set v (list (car x) (cadr x))))
'(a b c)
(list a b c)
)
with mapcar and a single list
(mapcar
'(lambda (x / val)
(setq val (eval x))
(set x (list (car val) (cadr val)))
)
'(a b c)
)
with foreach
(foreach x '(a b c)
((lambda (val)
(set x (list (car val) (cadr val)))
)
(eval x)
)
)