From ... From: Erik Naggum Subject: Re: [N]TRUNCATE-LIST ? Date: 2000/02/11 Message-ID: <3159291352590096@naggum.no>#1/1 X-Deja-AN: 584751611 References: mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 950311264 10997 195.0.192.66 (11 Feb 2000 23:21:04 GMT) Organization: Naggum Software; +47 8800 8879 or +1 510 435 8604; fax: +47 2210 9077; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 11 Feb 2000 23:21:04 GMT Newsgroups: comp.lang.lisp * Philip Lijnzaad | after some browsing in the HyperSpec, I couldn't find a function that yields, | as a list, the first N elts of the list passed as an argument, sort of the | opposites of [N]BUTLAST. have you looked at SUBSEQ for the non-destructive version? or a fairly plain SETF of NTHCDR for a destructive version? if you have to check for the length, use NTHCDR, see if you get a cons cell, then SETF its CDR. there's absolutely _no_ need to check the length of the list, which, incidentally, may be circular, so use LIST-LENGTH instead of LENGTH if you think you really have to. #:Erik