Changeset 2533


Ignore:
Timestamp:
06/22/03 18:19:30 (19 years ago)
Author:
piso
Message:

More autoloads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/list.lisp

    r2531 r2533  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: list.lisp,v 1.39 2003-06-22 17:55:45 piso Exp $
     4;;; $Id: list.lisp,v 1.40 2003-06-22 18:19:30 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2020(in-package "COMMON-LISP")
    2121
    22 (export '(list-length
    23           fifth sixth seventh eighth ninth tenth
    24           make-list
    25           copy-list copy-alist copy-tree
    26           revappend nconc
    27           butlast nbutlast
    28           ldiff
    29           complement constantly
    30           sublis nsublis
    31           member member-if member-if-not tailp adjoin
    32           acons pairlis
    33           assoc assoc-if assoc-if-not rassoc rassoc-if rassoc-if-not
    34           mapc mapcan mapl maplist mapcon))
    35 
    36 (defun list-length (list)
    37   (do ((n 0 (+ n 2))
    38        (y list (cddr y))
    39        (z list (cdr z)))
    40       (())
    41     (when (endp y) (return n))
    42     (when (endp (cdr y)) (return (+ n 1)))
    43     (when (and (eq y z) (> n 0)) (return nil))))
     22(autoload 'list-length)
    4423
    4524(defun fifth (list)
     
    5938  (%make-list size initial-element))
    6039
    61 (defun copy-list (list)
    62   (if (atom list)
    63       list
    64       (let ((result (list (car list))))
    65   (do ((x (cdr list) (cdr x))
    66        (splice result
    67          (cdr (rplacd splice (cons (car x) '())))))
    68             ((atom x)
    69              (unless (null x)
    70                (rplacd splice x))))
    71   result)))
     40(autoload 'copy-list)
    7241
    7342(defun copy-tree (object)
     
    7645      object))
    7746
    78 (defun revappend (x y)
    79   (do ((top x (cdr top))
    80        (result y (cons (car top) result)))
    81       ((endp top) result)))
    82 
     47(autoload 'revappend)
    8348(autoload '(butlast nbutlast) "butlast.lisp")
    8449(autoload 'ldiff)
     
    10267  (%member item list key test test-not))
    10368
    104 (defun member-if (test list &key key)
    105   (do ((list list (cdr list)))
    106       ((endp list) nil)
    107     (if (funcall test (apply-key key (car list)))
    108   (return list))))
    109 
    110 (defun member-if-not (test list &key key)
    111   (do ((list list (cdr list)))
    112       ((endp list) ())
    113     (if (not (funcall test (apply-key key (car list))))
    114   (return list))))
    115 
    116 (defun tailp (object list)
    117   (do ((list list (cdr list)))
    118       ((atom list) (eql list object))
    119     (if (eql object list)
    120   (return t))))
    121 
    122 (defun adjoin (item list &key key (test #'eql) (test-not nil notp))
    123   (if (let ((key-val (apply-key key item)))
    124   (if notp
    125       (member key-val list :test-not test-not :key key)
    126       (member key-val list :test test :key key)))
    127       list
    128       (cons item list)))
     69(autoload '(member-if member-if-not) "member-if.lisp")
     70(autoload 'tailp)
     71(autoload 'adjoin)
    12972
    13073(autoload '(union nunion
Note: See TracChangeset for help on using the changeset viewer.