3 ms·
The example they considered was removing the first element of the list, while that example is removing the last element. In terms of computational cost, this m
by lukeschlather 10y ago
The example they considered was removing the first element of the list, while that example is removing the last element.
In terms of computational cost, this makes sense: removing the last element of a list in lisp takes linear time with the size of the list, while removing the first element takes constant time. (If you're returning a copy this is moot, but if you're modifying in-place this could be a problem.)