1
0
mirror of synced 2026-05-05 07:34:31 +00:00
Files
Interlisp.medley/internal/test/LANGUAGE/AUTO/12-7-BOOLE.TEST

176 lines
12 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;; Function To Be Tested: BOOLE
;;
;; Source: Guy L Steele's CLTL
;; Section: 12.7 Logical Operations on Numbers
;; Page: 222
;;
;; Created By: Kelly Roach
;;
;; Creation Date: July 12,1986
;;
;; Last Update: July 12,1986
;;
;; Filed As: {ERIS}<LISPCORE>CML>TEST>12-7-BOOLE.TEST
;;
;;
;; Syntax: (BOOLE OP INTEGER1 INTEGER2)
;;
;; Function Description:
;; The function BOOLE takes an operation OP and two integers,
;; and returns an integer produced by performing the logical operation
;; specified by OP on the two integers. The precise values of
;; the sixteen constants are implementation-dependent, but they are
;; suitable for use as the first argument to BOOLE:
;;
;;
;; INTEGER1 0 0 1 1
;; INTEGER2 0 1 0 1 OPERATION PERFORMED
;; BOOLE-CLR
;; 0 0 0 0 ALWAYS 0
;; BOOLE-SET 1 1 1 1 ALWAYS 1
;; BOOLE-1
;; 0 ( 0 1 1 INTEGER1
;; BOOLE-2 0 1 0 1 INTEGER2
;; BOOLE-C1
;; 1 1 0 0 COMPLEMENT OF INTEGER1
;; BOOLE-C2 1 0 1 0 COMPLEMENT OF INTEGER2
;; BOOLE-AND
;; 0 0 0 1 AND
;; BOOLE-IOR 0 1 1 1 INCLUSIVE OR
;; BOOLE-XOR
;; 0 1 1 8 ;; Function To Be Tested: imagpart
;;
;; Source: Common Lisp by Guy Steele
;; Section 12.6: Type Conversions and Component Extractions
;; on Numbers Page: 220
;;
;; Created By: John Park
;;
;; Creation Date: July 17, 86
;;
;; Last Update:
;;
;; Filed as: {eris}<lispcore>cml>test>12-6-imagpart.test
;;
;; Syntax: imagpart number
;;
;; Function Description: This function returns the imaginary part of a complex
;; number. If the number is a non-complex, then imagpart returns the floating
;; point zero of the same format.
;;
;; Argument(s): number
;;
;; Returns: real part of a complex number or zero
;;
;; Constraints/limitations: None
(do-test imagpart-test
(and (eql (imagpart 198) 0)
(eql (imagpart 2.0) 0.0)
(eql (imagpart #C(3 8)) 8)
(eql (imagpart #C(2.0 8.0)) 8.0)))
STOP
),Qãéêl;X'><3E>¼âf),­ "k§?(<28>
Fp#XCL Compiler output for source file {CORE}HACK.;1
Source file created Tuesday, 19 April 1988, 11:52:44.
FASL file created Tuesday, 19 April 1988, 12:15:12.
ÿ<EFBFBD>oc¿o ˜’Œ*TEST-FILE-NAME*˜‘˜ŒXCL-USER˜Œ2 top-level forms˜<>ŒFUNCTION˜ ˜<>Œ
IN-PACKAGE˜ŒXCL-TEST˜Œ12-6-INTEGER-DECODE-FLOAT<00> Óo»h¼K¹n½KWgo
¿go
¿oc¿i¼gh¹_¿OgðL<E28098>OÃh‡OK
‘°Wog ¿ic¿±Ro»h¼K¹nã½KWW_¿h_¿h_¿h_¿O<0E>ƒO°(O _¿O˜OO&_¿ˆOh__¿O_¿°Ôc ¢±¸g W
¢±§W_¿h_¿h_¿h_¿O<0E>ƒO°(O _¿O˜OO&_¿ˆOh__¿O_¿°Ôc"²ag W"
²RW_¿h_¿h_¿h_¿O<0E>ƒO°(O _¿O˜OO&_¿ˆOh__¿O_¿°Ôc$g W$
€h€h€h€h€h¼gh¹_¿OgðL<E28098>OÃh‡OK
‘°Wog ¿ic¿gJ ¿h˜•Œ*CONDITION-HANDLER-BINDINGS*˜’Œ*CATCH-RETURN-PC*˜‘˜ŒSYSTEM˜’Œ*TEST-CLEANUP-FORMS*™˜’Œ*CATCH-RETURN-TO*™  ˜’ŒTEST-DECODE-NUMBERS˜˜ŒXCL-TEST
˜<>Œ*ERROR-OUTPUT*˜’Œ *ANY-ERRORS*™˜’ŒTYPE-VALUE-RESULT™˜’ŒVALUE-LIMIT-RESULT™˜’Œ SIGN-RESULT™˜Œ1 top-level form ˜“͘<C38D>ŒEVALÀ˜<C380>ŒFORMAT½˜’ŒCURRENT-FILE-NAME™®˜’ŒCONDITION-CASE-ERROR™ }˜•Œ%NOTANY-SINGLEx˜<78>ŒSYMBOL-FUNCTIONO˜ŒCHECK-DECODE-SIGN™.™)™ÿ˜’ŒCHECK-DECODE-VALUE™ܘ•Œ
%EVERY-SINGLE×™«˜<C2AB>ŒINTEGER-DECODE-FLOATn™k™\™,˜•ŒSETF-SYMBOL-FUNCTION!™#Ș<C388>ŒPROGNº˜’ŒINTEGER-DECODE-FLOAT-TEST™£˜<C2A3>ŒERRORš˜<C5A1>ŒNORMAL‹™'u˜<75>ŒNULL&™(Ô˜<C394>ŒINTEGERPh˜ŒINTEGER-DECODE-FLOAT-TEST-SETUP™Q™&H™'9™'%™¶˜ŒTest "~A" failed in file "~A"~%y˜˜˜’ŒCREATE-CONDITION-CASE-LITERALS™ ˜“˜<>ŒQUOTE™&d˜Œ.:BEFORE forms for test "~A" in file ~S failed.0˜“ „„?€„@@„@ã33„Á „C•™š„D€®„ÍdÉ(!@jýó™@ o:@jýóh@ o:˜Œlambda in 1 top-level form˜“˜“˜ŒX˜<>Œ
FLOAT-SIGN™7„?€
„¿€r@i€h²@oó¸HH†@oýó€h²/@ @ @
ýó²@ @ @
ýóhih@i€h“j@ÿ€h²@ 3 i€hj@ ÿhh˜Œlambda in 1 top-level form˜“˜“˜ŒF
i™"]™"A˜<41>ŒEXPT<˜<>ŒFLOAT-PRECISION8˜<38>Œ FLOAT-RADIX4™",™<)™=%™>!™" ˜›˜“™,˜“™-™&šBÿÿand 1) (list x)))
boole-and-test-conditions))
(equal (mapcar #'eval boole-and-tet-result)
boole-and-result)))
(do-test boole-ior-tesM* ( (and (setq boole-ior-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-ior) x))
integer-pairs))
(setq boole-ior-tes´;ô8Àïõ©ºººººººººººººººººººººº¦¶õ<C2B6>¸õxõ¿÷¦¾õ÷õõ¦&µºº¦÷̓ô÷õº÷¦¾¤üõ÷õ<C3B7>·º¦¾µxÃõ&µ··º¿©ºººººººxor-test-conditions))
(equal (mapcar #'eval boole-xor-test-result)
boole-xor-result)))
(do-test boole-eqv-test
(and (setq boole-eqv-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-eqv) x))
integer-pairs))
(setq boole-eqv-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-eqv-test-conditions))
(equal (mapcar #'eval boole-eqv-test-result)
boole-eqv-result)))
(do-test boole-nand-test
(and (setq boole-nand-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-nand) x))
integer-pairs))
(setq boole-nand-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-nand-test-conditions))
(equal (mapcar #'eval boole-nand-test-result)
boole-nand-result)))
(do-test boole-nor-test
(and (setq boole-nor-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-nor) x))
integer-pairs))
(setq boole-nor-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-nor-test-conditions))
(equal (mapcar #'eval boole-nor-test-result)
boole-nor-result)))
(do-test boole-andc1-test
(and (setq boole-andc1-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-andc1) x))
integer-pairs))
(setq boole-andc1-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-andc1-test-conditions))
(equal (mapcar #'eval boole-andc1-test-result)
boole-andc1-result)))
(do-test boole-andc2-test
(and (setq boole-andc2-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-andc2) x))
integer-pairs))
(setq boole-andc2-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-andc2-test-conditions))
(equal (mapcar #'eval boole-andc2-test-result)
boole-andc2-result)))
(do-test boole-orc1-test
(and (setq boole-orc1-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-orc1) x))
integer-pairs))
(setq boole-orc1-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-orc1-test-conditions))
(equal (mapcar #'eval boole-orc1-test-result)
boole-orc1-result)))
(do-test boole-orc2-test
(and (setq boole-orc2-test-conditions
(mapcar #'(lambda (x) (append '(boole boole-orc2) x))
integer-pairs))
(setq boole-orc2-test-result
(mapcar #'(lambda (x) (append '(logand 1) (list x)))
boole-orc2-test-conditions))
(equal (mapcar #'eval boole-orc2-test-result)
boole-orc2-result))))
STOP