From 28a82d590a536e520a46e0703a08829485ae8bf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 24 May 2013 02:25:35 +0100 Subject: [PATCH] concatenate-two --- src/string.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)) -- 1.7.10.4