X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-char.lisp;h=0437cc372fa07b7f5d25f080bfe7ad3c16c29050;hb=863d1c0c3314d9002e511e9f98c00d9f0f9bfa78;hp=a00298903d74281f6ce818f9e25f5cbf8de84cee;hpb=334af30b26555f0bf706f7157b399bdbd4fad548;p=sbcl.git diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index a002989..0437cc3 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -82,19 +82,19 @@ (defun char-code (char) #!+sb-doc - "Returns the integer code of CHAR." + "Return the integer code of CHAR." (etypecase char (base-char (char-code (truly-the base-char char))))) (defun char-int (char) #!+sb-doc - "Returns the integer code of CHAR. This is the same as char-code, as + "Return the integer code of CHAR. This is the same as char-code, as CMU Common Lisp does not implement character bits or fonts." (char-code char)) (defun code-char (code) #!+sb-doc - "Returns the character with the code CODE." + "Return the character with the code CODE." (declare (type char-code code)) (code-char code)) @@ -218,6 +218,13 @@ ;; Else, fail. (t nil)))) +(defun whitespace-char-p (x) + (and (characterp x) + (or (char= x #\space) + (char= x (code-char tab-char-code)) + (char= x (code-char return-char-code)) + (char= x #\linefeed)))) + (defun alphanumericp (char) #!+sb-doc "Given a character-object argument, alphanumericp returns T if the @@ -228,14 +235,14 @@ (defun char= (character &rest more-characters) #!+sb-doc - "Returns T if all of its arguments are the same character." + "Return T if all of the arguments are the same character." (do ((clist more-characters (cdr clist))) ((atom clist) T) (unless (eq (car clist) character) (return nil)))) (defun char/= (character &rest more-characters) #!+sb-doc - "Returns T if no two of its arguments are the same character." + "Return T if no two of the arguments are the same character." (do* ((head character (car list)) (list more-characters (cdr list))) ((atom list) T) @@ -246,7 +253,7 @@ (defun char< (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly increasing alphabetic order." + "Return T if the arguments are in strictly increasing alphabetic order." (do* ((c character (car list)) (list more-characters (cdr list))) ((atom list) T) @@ -256,7 +263,7 @@ (defun char> (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly decreasing alphabetic order." + "Return T if the arguments are in strictly decreasing alphabetic order." (do* ((c character (car list)) (list more-characters (cdr list))) ((atom list) T) @@ -266,7 +273,7 @@ (defun char<= (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly non-decreasing alphabetic order." + "Return T if the arguments are in strictly non-decreasing alphabetic order." (do* ((c character (car list)) (list more-characters (cdr list))) ((atom list) T) @@ -276,7 +283,7 @@ (defun char>= (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly non-increasing alphabetic order." + "Return T if the arguments are in strictly non-increasing alphabetic order." (do* ((c character (car list)) (list more-characters (cdr list))) ((atom list) T) @@ -293,7 +300,7 @@ (defun char-equal (character &rest more-characters) #!+sb-doc - "Returns T if all of its arguments are the same character. + "Return T if all of the arguments are the same character. Font, bits, and case are ignored." (do ((clist more-characters (cdr clist))) ((atom clist) T) @@ -303,7 +310,7 @@ (defun char-not-equal (character &rest more-characters) #!+sb-doc - "Returns T if no two of its arguments are the same character. + "Return T if no two of the arguments are the same character. Font, bits, and case are ignored." (do* ((head character (car list)) (list more-characters (cdr list))) @@ -317,7 +324,7 @@ (defun char-lessp (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly increasing alphabetic order. + "Return T if the arguments are in strictly increasing alphabetic order. Font, bits, and case are ignored." (do* ((c character (car list)) (list more-characters (cdr list))) @@ -328,7 +335,7 @@ (defun char-greaterp (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly decreasing alphabetic order. + "Return T if the arguments are in strictly decreasing alphabetic order. Font, bits, and case are ignored." (do* ((c character (car list)) (list more-characters (cdr list))) @@ -339,7 +346,7 @@ (defun char-not-greaterp (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly non-decreasing alphabetic order. + "Return T if the arguments are in strictly non-decreasing alphabetic order. Font, bits, and case are ignored." (do* ((c character (car list)) (list more-characters (cdr list))) @@ -350,7 +357,7 @@ (defun char-not-lessp (character &rest more-characters) #!+sb-doc - "Returns T if its arguments are in strictly non-increasing alphabetic order. + "Return T if the arguments are in strictly non-increasing alphabetic order. Font, bits, and case are ignored." (do* ((c character (car list)) (list more-characters (cdr list))) @@ -363,7 +370,7 @@ (defun char-upcase (char) #!+sb-doc - "Returns CHAR converted to upper-case if that is possible." + "Return CHAR converted to upper-case if that is possible." (declare (character char)) (if (lower-case-p char) (code-char (- (char-code char) 32)) @@ -371,7 +378,7 @@ (defun char-downcase (char) #!+sb-doc - "Returns CHAR converted to lower-case if that is possible." + "Return CHAR converted to lower-case if that is possible." (declare (character char)) (if (upper-case-p char) (code-char (+ (char-code char) 32))