2

Any ideas how to go about this? I am trying to not create any new nodes.

Drew
  • 29,895
  • 7
  • 74
  • 104

2 Answers2

3

Call nreverse.

Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171
  • If it's not homework, that's the right answer (just make sure to assign the result to something, like (setf foo-prime (nreverse foo))). If it's homework, I'd rather the questioner said so. – David Thornley Oct 02 '09 at 21:56
1

Draw a standard cons-cell diagram of what a list with 5 elements or so looks like. That should give you a big clue right there.

Don't forget to keep a reference to the last cell in the list, which will be your new list head when done.

Michael H.
  • 862
  • 1
  • 7
  • 14