Answer to Question 34B-1

void sort(ListCell*& L)
{
  ListCell* R = emptyList;
  for(ListCell* p = L; !isEmpty(p); p = tail(p))
  {
    insert(head(p), R);
  }
  destroy(L);
  L = R;
}