dkennard
2007-06-28, 09:57 AM
Its been a long while since I programmed any Lisp, I've had a look through the forum but cant find a way to add to an element to a position in a list other then the start or end.
I have a list of 2d points:
((1.0 1.0) (2.0 2.0) (3.0 3.0) (4.0 4.0) (5.0 5.0))
and another 2d point:
(6.0 6.0)
I want to end up with the 2d point inserted into the list somewhere other then the first or last item eg:
((1.0 1.0) (2.0 2.0) (3.0 3.0) (6.0 6.0) (4.0 4.0) (5.0 5.0))
I'm guessing there is a simple way to do this but its got me stumped. Thanks for any advice you can give me.
I have a list of 2d points:
((1.0 1.0) (2.0 2.0) (3.0 3.0) (4.0 4.0) (5.0 5.0))
and another 2d point:
(6.0 6.0)
I want to end up with the 2d point inserted into the list somewhere other then the first or last item eg:
((1.0 1.0) (2.0 2.0) (3.0 3.0) (6.0 6.0) (4.0 4.0) (5.0 5.0))
I'm guessing there is a simple way to do this but its got me stumped. Thanks for any advice you can give me.