home *** CD-ROM | disk | FTP | other *** search
Lisp/Scheme | 1988-04-07 | 1.0 KB | 35 lines | [TEXT/ttxt] |
- ;; Larry Mulcahy 1988
- ;; predicates
-
- (provide 'predicate)
- (require 'character "char")
- (require 'array)
-
- (defconstant *FUNCTION-TYPES* '(subr fsubr closure))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; functionp
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defun functionp (x) (member (type-of x) *FUNCTION-TYPES*))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; char-equal
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defun char-equal (x y) ; strip away shift & control bits
- (= (logand (char-int x) *NOT-SHIFT-CONTROL-BITS*)
- (logand (char-int y) *NOT-SHIFT-CONTROL-BITS*)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; equalp
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defun equalp (x y)
- (cond
- ((and (stringp x) (stringp y)) (string-equal x y))
- ((and (characterp x) (characterp y)) (char-equal x y))
- ((and (arrayp x) (arrayp y)) (vector-equal x y))
- ((equal x y))
- ))
-