In this example, there is a cons-cell (foo . bar)
which needs a two (2) step approach so that it can be copied using copy-sequence
:
First, there needs to be a test to identify this particular type of cons-cell
(foo . bar)
so that the transformation function(s) are not unnecessarily applied to lists that are of a different form.Second, once this particular type of cons-cell is identified, the cons-cell needs to be transformed into a list that
copy-sequence
will accept.
How can this be accomplished?
proper-list-p
, which I haven't tried before. Greatly appreciated. I'm operating asort
function, which is destructive and I'd like to keep a copy of the original list for later use.