
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all!
I have a list of a lists called in this example "list"
It looks like this:
((1.0 1.0 0.0) (3.0 5.0 0.0) (6.0 4.0 0.0))
I would like to add 5.0 to the car of each list, 4.0 to the cadr of each one, and nothing to the caadr of them. (i can even omit the third part)
So i would like to get this at the end in a variable called offs.
((6.0 5.0 0.0) (8.0 9.0 0.0) (11.0 8.0 0.0))
I am trying this line:
(setq offs (mapcar '(lambda (a) ((+ 5.0 (car a))(+ 4.0 (cadr a))(+ 0 (caadr a)))) list))
But of course it doesnt work, and i feel like its total wrong, because i dont know what will mapcar return in this case, but i dont think its even a list. I think i should include "list" and "append" too to somewhere.
Can someone help? 🙂
Thanks in advance!
Solved! Go to Solution.