From: David Vázquez Date: Fri, 24 May 2013 01:25:35 +0000 (+0100) Subject: concatenate-two X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=28a82d590a536e520a46e0703a08829485ae8bf5;p=jscl.git concatenate-two --- diff --git a/src/string.lisp b/src/string.lisp index 7e9ae1e..6f88024 100644 --- a/src/string.lisp +++ b/src/string.lisp @@ -53,3 +53,16 @@ (list g!value) `(aset ,g!string ,g!index ,g!value) `(char ,g!string ,g!index)))) + +(defun concatenate-two (string1 string2) + (let* ((len1 (length string1)) + (len2 (length string2)) + (string (make-array (+ len1 len2) :element-type 'character)) + (i 0)) + (dotimes (j len1) + (aset string i (char string1 j)) + (incf i)) + (dotimes (j len2) + (aset string i (char string2 j)) + (incf i)) + string))