Lee Mac Posted December 28, 2008 Posted December 28, 2008 If one has two list which correspond to each other, can you do a "double foreach" i.e. foreach x list1 y list2.... ? Quote
CAB Posted December 29, 2008 Posted December 29, 2008 Not sure of your question but I think not. You can do this: Mapcar '(lambda(x y)......) list1 list2) or this: ;; Add values of two list (mapcar '+ (list 1 2 3) (list 3 2 2)) (4 4 5) Quote
ASMI Posted December 29, 2008 Posted December 29, 2008 You can also combine both (or more lists): Command: (mapcar 'list '(1 2 3) '(5 6 7)) ((1 5) (2 6) (3 7)) and proceed it with 'foreach'. Quote
Lee Mac Posted December 29, 2008 Author Posted December 29, 2008 Thanks guys, I should've approached it that way instead of overcomplicating things as usual. Cheers, and Happy New Year. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.