From: David Vázquez Date: Fri, 24 May 2013 01:27:41 +0000 (+0100) Subject: Add make-string X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e5737c90c2a5c8299452d320bef69e3ec6ceb6e1;p=jscl.git Add make-string --- 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))