Pairing list elementes
Posted: Wed Jun 22, 2011 8:56 am
Hi, because of my ignorance im stuck whit this problem.
I have a list, example:
(1024 -42 42 123 0 6 -1 0 0 -2)
but i need it to look like this:
(1024 . -42) (42 . 123) (0 . 6) (-1 . 0) (0 . -2)
I have already made this function(i need it like this):
(defun make-point (x y) (cons x y))
The problem is that i dont not how to pairing the elements by the make-point function, can you halp me pls?
EDIT: it will be usefull even create two list of alternate elements like:
(1024 42 0 -1 0)
(-42 123 6 0 -2)
I have a list, example:
(1024 -42 42 123 0 6 -1 0 0 -2)
but i need it to look like this:
(1024 . -42) (42 . 123) (0 . 6) (-1 . 0) (0 . -2)
I have already made this function(i need it like this):
(defun make-point (x y) (cons x y))
The problem is that i dont not how to pairing the elements by the make-point function, can you halp me pls?
EDIT: it will be usefull even create two list of alternate elements like:
(1024 42 0 -1 0)
(-42 123 6 0 -2)