Skip to content

Commit

Permalink
Declare string to be simple-strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
stassats committed Jun 7, 2011
1 parent 66f9c38 commit 054a959
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion disk.lisp
Expand Up @@ -58,10 +58,11 @@
(satisfies ascii-string-p)))

(defun ascii-string-p (string)
(and (stringp string)
(and (simple-string-p string)
(every (lambda (x)
(char< x +ascii-char-limit+))
string)))

;;;

(defun slot-effective-definition (class slot-name)
Expand Down Expand Up @@ -230,10 +231,12 @@
+char-length+)))))

(defun write-ascii-string (string stream)
(declare (simple-string string))
(loop for char across string
do (write-n-bytes (char-code char) 1 stream)))

(defun write-multibyte-string (string stream)
(declare (simple-string string))
(loop for char across string
do (write-n-bytes (char-code char) +char-length+ stream)))

Expand Down

0 comments on commit 054a959

Please sign in to comment.