source: trunk/j/src/org/armedbear/lisp/list.lisp @ 9266

Last change on this file since 9266 was 8972, checked in by piso, 16 years ago

COPY-TREE: %CAR, %CDR.

File size: 1.6 KB
Line 
1;;; list.lisp
2;;;
3;;; Copyright (C) 2003-2005 Peter Graves
4;;; $Id: list.lisp,v 1.43 2005-04-23 16:17:07 piso Exp $
5;;;
6;;; This program is free software; you can redistribute it and/or
7;;; modify it under the terms of the GNU General Public License
8;;; as published by the Free Software Foundation; either version 2
9;;; of the License, or (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20(in-package "SYSTEM")
21
22(defun fifth (list)
23  (car (cddddr list)))
24(defun sixth (list)
25  (cadr (cddddr list)))
26(defun seventh (list)
27  (caddr (cddddr list)))
28(defun eighth (list)
29  (cadddr (cddddr list)))
30(defun ninth (list)
31  (car (cddddr (cddddr list))))
32(defun tenth (list)
33  (cadr (cddddr (cddddr list))))
34
35(defun make-list (size &key initial-element)
36  (%make-list size initial-element))
37
38(defun copy-tree (object)
39  (if (consp object)
40      (cons (copy-tree (%car object)) (copy-tree (%cdr object)))
41      object))
42
43(defmacro apply-key (key element)
44  `(if ,key
45       (funcall ,key ,element)
46       ,element))
47
48(defun complement (f)
49  #'(lambda (&rest x) (not (apply f x))))
50
51(defun constantly (x)
52  #'(lambda (&rest args) x))
53
54(defun member (item list &key key test test-not)
55  (%member item list key test test-not))
Note: See TracBrowser for help on using the repository browser.