From e5737c90c2a5c8299452d320bef69e3ec6ceb6e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 24 May 2013 02:27:41 +0100 Subject: [PATCH] Add make-string --- src/string.lisp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/string.lisp b/src/string.lisp index 6f88024..8c29abf 100644 --- a/src/string.lisp +++ b/src/string.lisp @@ -16,6 +16,15 @@ ;; (defun stringp (x) ;; (and (vectorp x) (eq (array-element-type x) 'character))) +(defun stringp (s) + (stringp s)) + +(defun make-string (n &key initial-element) + (make-array n :element-type 'character :initial-element initial-element)) + +;; (defun char-to-string (x) +;; (make-string 1 :initial-element x)) + (defun string (x) (cond ((stringp x) x) ((symbolp x) (symbol-name x)) @@ -41,9 +50,6 @@ (when (and (= i (1- len-1)) (> len-2 len-1)) (return-from string< (1+ i)))))))) -(defun stringp (s) - (stringp s)) - (define-setf-expander char (string index) (let ((g!string (gensym)) (g!index (gensym)) -- 1.7.10.4