From e2040ea9a5d5794b68a34277d459d52b475d6eff Mon Sep 17 00:00:00 2001 From: Ken Harris Date: Fri, 14 Jun 2013 08:15:40 -0700 Subject: [PATCH] COPY-SEQ --- src/sequence.lisp | 3 +++ tests/strings.lisp | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sequence.lisp b/src/sequence.lisp index 7f86a85..cda0b41 100644 --- a/src/sequence.lisp +++ b/src/sequence.lisp @@ -176,3 +176,6 @@ ((= j b) new) (aset new i (aref seq j))))) (t (not-seq-error seq)))) + +(defun copy-seq (sequence) + (subseq sequence 0)) diff --git a/tests/strings.lisp b/tests/strings.lisp index 22713a2..92022e9 100644 --- a/tests/strings.lisp +++ b/tests/strings.lisp @@ -130,12 +130,6 @@ (test (string= (string-capitalize "pipe 13a, foo16c") "Pipe 13a, Foo16c")) (test (string= (string-capitalize "a fool" :start 2 :end nil) "a Fool")) -;; JSCL HACK: a simple COPY-SEQ for testing string functions, since we don't have a real one yet -- remove me -(defun copy-seq (string) - (let ((copy (make-string (length string)))) - (dotimes (i (length string) copy) - (aset copy i (char string i))))) - (test (let ((str (copy-seq "0123ABCD890a"))) (and (string= (nstring-downcase str :start 5 :end 7) "0123AbcD890a") (string= str "0123AbcD890a")))) -- 1.7.10.4