пятница, 19 апреля 2013 г.

nconc

Lispers know that destructive list functions are dangerous, that you should know that the data is fresh consed. I've known this too, but still today I was still bitten by nconc. When I applied it to two arguments that shared structure, it returned a circular list. Try this:

(setf *print-circle* t)
(let ((x (list 1 2 3)))
   (nconc x x))

Be careful!

Комментариев нет:

Отправить комментарий