Changeset 5231


Ignore:
Timestamp:
12/20/03 17:02:49 (17 years ago)
Author:
piso
Message:

SUBSEQ is now implemented in Primitives.java.

File:
1 edited

Legend:

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

    r4688 r5231  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: sequences.lisp,v 1.53 2003-11-10 00:13:04 piso Exp $
     4;;; $Id: sequences.lisp,v 1.54 2003-12-20 17:02:49 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    3434(defmacro make-sequence-like (sequence length)
    3535  `(make-sequence-of-type (type-of ,sequence) ,length))
    36 
    37 
    38 ;;; SUBSEQ (from CMUCL)
    39 
    40 (defun list-subseq (sequence start &optional end)
    41   (if (and end (>= start end))
    42       ()
    43       (let* ((groveled (nthcdr start sequence))
    44        (result (list (car groveled))))
    45   (if groveled
    46       (do ((list (cdr groveled) (cdr list))
    47      (splice result (cdr (rplacd splice (list (car list)))))
    48      (index (1+ start) (1+ index)))
    49               ((or (atom list) (and end (= index end)))
    50                result))
    51       ()))))
    52 
    53 (defun subseq (sequence start &optional end)
    54   (if (listp sequence)
    55       (list-subseq sequence start end)
    56       (vector-subseq sequence start end)))
Note: See TracChangeset for help on using the changeset viewer.