45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
;; Function To Be Tested: NOT
|
|
;;
|
|
;; Source: Guy L Steele's CLTL
|
|
;; Section: 6.4 Logical Operators
|
|
;; Page: 82
|
|
;;
|
|
;; Created By: Kelly Roach
|
|
;;
|
|
;; Creation Date: 25-Jul-86
|
|
;;
|
|
;; Last Update: 25-Jul-86
|
|
;;
|
|
;; Filed As: {ERIS}<LISPCORE>CML>TEST>6-4-NOT.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (NOT X)
|
|
;;
|
|
;; Function Description:
|
|
;; NOT returns T if X is NIL, and otherwise returns NIL.
|
|
;; It therefore inverts its argument considered as a Boolean value.
|
|
;;
|
|
;; function NULL is the same as NOT; both functions are included for the sake
|
|
;; of clarity. As a matter of style,
|
|
;; it is customary to use NULL to check whether something is the empty list
|
|
;; and to use NOT to invert the sense of a logical value.
|
|
;;
|
|
;; Argument(s): See CLTL manual.
|
|
;;
|
|
;; Returns: See CLTL manual.
|
|
;;
|
|
|
|
(DO-TEST "TEST NOT 1"
|
|
(AND (NOT NIL)
|
|
(EQ (NOT NIL) T)
|
|
(EQ (NOT T) NIL)
|
|
(EQ (NOT 100) NIL)
|
|
(EQ (NOT "STRING") NIL)
|
|
(EQ (NOT 'ATOM) NIL)
|
|
(EQ (NOT (NOT T)) T)
|
|
(EQ (NOT (NOT NIL)) NIL)
|
|
(EQ (NOT (NOT 1000)) T)
|
|
(EQ (NOT (NOT (NOT NIL))) T)))
|
|
|
|
STOP
|