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