Changeset 7829


Ignore:
Timestamp:
09/27/04 13:58:58 (17 years ago)
Author:
piso
Message:

(remove-duplicates (list 0 1 2 0 1 2 0 1 2 0 1 2) :start 3 :end 9) => (0 1 2 0 1 2 0 1 2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/remove-duplicates.lisp

    r6228 r7829  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: remove-duplicates.lisp,v 1.7 2004-03-13 17:51:01 piso Exp $
     4;;; $Id: remove-duplicates.lisp,v 1.8 2004-09-27 13:58:58 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    1818;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    1919
    20 (in-package "SYSTEM")
     20(in-package #:system)
    2121
    2222;;; Adapted from CMUCL.
     
    2727   (current list))
    2828    (do ((index 0 (1+ index)))
    29       ((= index start))
     29        ((= index start))
    3030      (setq splice (cdr (rplacd splice (list (car current)))))
    3131      (setq current (cdr current)))
    32     (do ((index 0 (1+ index)))
    33       ((or (and end (= index end))
    34            (atom current)))
     32    (do ((index start (1+ index)))
     33        ((or (and end (= index end))
     34             (atom current)))
    3535      (if (or (and from-end
    3636       (not (member (apply-key key (car current))
     
    5252      (setq current (cdr current)))
    5353    (do ()
    54       ((atom current))
     54        ((atom current))
    5555      (setq splice (cdr (rplacd splice (list (car current)))))
    5656      (setq current (cdr current)))
     
    6464  (jndex start))
    6565    (do ()
    66       ((= index start))
     66        ((= index start))
    6767      (setf (aref result index) (aref vector index))
    6868      (setq index (1+ index)))
Note: See TracChangeset for help on using the changeset viewer.