From ... From: Erik Naggum Subject: Re: deleting a nth element of a list Date: 2000/05/25 Message-ID: <3168226623807923@naggum.no>#1/1 X-Deja-AN: 627049571 References: <392ccbf1.12603723@news.vtc.ru> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 959237826 17013 195.0.192.66 (25 May 2000 06:57:06 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6 Mime-Version: 1.0 NNTP-Posting-Date: 25 May 2000 06:57:06 GMT Newsgroups: comp.lang.lisp * Arseny Slobodjuck | Which is the best way to delete some element, whose number is known | from a list? Is it the following? Clever solution, but I tend to think that plain old ordinary list hacking is simpler: (defun delete-nth (n list) (if (zerop n) (cdr list) (let ((cons (nthcdr (1- n) list))) (if cons (setf (cdr cons) (cddr cons)) cons)))) #:Erik -- If this is not what you expected, please alter your expectations.