From: Ken Harris Date: Fri, 14 Jun 2013 15:15:40 +0000 (-0700) Subject: COPY-SEQ X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e2040ea9a5d5794b68a34277d459d52b475d6eff;p=jscl.git COPY-SEQ --- 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"))))