Changeset 5260
- Timestamp:
- Sep 24, 2006, 7:14:05 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lib/chars.lisp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lib/chars.lisp
r5251 r5260 68 68 69 69 70 ;True for ascii codes 1 3and 32-126 inclusive.70 ;True for ascii codes 10 and 32-126 inclusive. 71 71 (defun standard-char-p (c) 72 72 "The argument must be a character object. STANDARD-CHAR-P returns T if the … … 82 82 83 83 84 ; if no table - then what?85 84 (defun upper-case-p (c) 86 85 "The argument must be a character object; UPPER-CASE-P returns T if the 87 86 argument is an upper-case character, NIL otherwise." 88 87 (let* ((code (char-code c))) 89 (declare (optimize (speed 3)(safety 0))) 90 (and (%i>= code (char-code #\A)) 91 (%i<= code (char-code #\Z))))) 92 93 94 95 96 ; I assume nobody cares that this be blindingly fast 88 (declare (type (mod #x110000) code)) 89 (and (>= code (char-code #\A)) 90 (<= code (char-code #\Z))))) 91 92 93 94 97 95 (defun both-case-p (c) 98 96 "The argument must be a character object. BOTH-CASE-P returns T if the … … 100 98 both upper and lower case. For ASCII, this is the same as ALPHA-CHAR-P." 101 99 (let* ((code (char-code c))) 102 (declare (optimize (speed 3)(safety 0))) 103 (if (%i>= code (char-code #\A)) 104 (if (%i<= code (char-code #\Z)) 105 t 106 (if (%i>= code (char-code #\a)) 107 (%i<= code (char-code #\z))))))) 100 (declare (type (mod #x110000) code)) 101 (or (and (>= code (char-code #\A)) 102 (<= code (char-code #\Z))) 103 (and (>= code (char-code #\a)) 104 (<= code (char-code #\z)))))) 108 105 109 106 (defun alphanumericp (c) … … 111 108 argument is either numeric or alphabetic." 112 109 (let ((code (char-code c))) 113 (declare ( fixnumcode))110 (declare (type (mod #x110000) code)) 114 111 (or 115 112 (and (>= code (char-code #\0)) … … 156 153 (return)))))) 157 154 158 ; Compares each char against all following chars, not just next one. Tries159 ; to be fast for one or two args.155 ;;; Compares each char against all following chars, not just next one. Tries 156 ;;; to be fast for one or two args. 160 157 (defun char-not-equal (char &rest others) 161 158 "Return T if no two of the arguments are the same character. … … 165 162 (let* ((rest (cdr others))) 166 163 (cond 167 (rest ; more than 2 args, no table164 (rest 168 165 (setq char (char-code (char-upcase char))) 169 166 (do ((list others (cdr list)))
Note:
See TracChangeset
for help on using the changeset viewer.
