cs: use wraparound functions for hashing

Change hash-code calculations to use `fx+/wraparound` and
`fxsll/wraparound` instead of `#3%fx+` and `#3%fxsll`. The resulting
code should be the same in the default unsafe compilation mode for the
Racket core, but the `wraparound` versions can be checked in safe
mode.

Also, fill in missing tests in Chez Scheme, which exposed cp0 problems
with `fx-/wraparound`.
This commit is contained in:
Matthew Flatt 2020-11-19 10:55:43 -07:00
parent 53c14c78d6
commit b5a9fbb03d
11 changed files with 277 additions and 153 deletions

View File

@ -6,11 +6,16 @@
(define 64-bit? (= (system-type 'word) 64))
(define (fixnum-width) (if (eq? 'racket (system-type))
(define (fixnum-width) (if (eq? 'racket (system-type 'vm))
(if 64-bit? 63 31)
(if 64-bit? 61 30)))
(define (least-fixnum) (- (expt 2 (fixnum-width))))
(define (greatest-fixnum) (sub1 (expt 2 (fixnum-width))))
(define (least-fixnum) (- (expt 2 (sub1 (fixnum-width)))))
(define (greatest-fixnum) (sub1 (expt 2 (sub1 (fixnum-width)))))
(test #t fixnum? (least-fixnum))
(test #t fixnum? (greatest-fixnum))
(test #f fixnum? (sub1 (least-fixnum)))
(test #f fixnum? (add1 (greatest-fixnum)))
(test #t fixnum-for-every-system? 0)
(test #t fixnum-for-every-system? -100)

View File

@ -465,6 +465,23 @@
(test-cp0-expansion eqv? '(r6rs:fx+ 3 3) 6)
)
(mat fx+/wraparound
(eqv? (fx+/wraparound 3 0) 3)
(eqv? (fx+/wraparound 3 1) 4)
(eqv? (fx+/wraparound -3 4) 1)
(error? (fx+/wraparound '(a . b) 0))
(error? (fx+ (add1 (most-positive-fixnum)) 1))
(error? (fx+ 1 (add1 (most-positive-fixnum))))
(error? (fx+ (sub1 (most-negative-fixnum)) 1))
(error? (fx+ 1 (sub1 (most-negative-fixnum))))
(eqv? (fx+/wraparound (most-positive-fixnum) 1) (most-negative-fixnum))
(eqv? (fx+/wraparound (most-positive-fixnum) 2) (add1 (most-negative-fixnum)))
(eqv? (fx+/wraparound (most-negative-fixnum) -1) (most-positive-fixnum))
(eqv? (fx+/wraparound (most-negative-fixnum) -2) (sub1 (most-positive-fixnum)))
(eqv? (fx+/wraparound (most-positive-fixnum) (most-positive-fixnum)) -2)
(eqv? (fx+/wraparound (most-negative-fixnum) (most-negative-fixnum)) 0)
)
(mat fx-
(eqv? (fx- 3 0) 3)
(eqv? (fx- 3 1) 2)
@ -533,6 +550,23 @@
(test-cp0-expansion eqv? '(r6rs:fx- 3) -3)
)
(mat fx-/wraparound
(eqv? (fx-/wraparound 3 0) 3)
(eqv? (fx-/wraparound 3 1) 2)
(eqv? (fx-/wraparound -3 4) -7)
(error? (fx-/wraparound '(a . b) 0))
(error? (fx- (add1 (most-positive-fixnum)) 1))
(error? (fx- 1 (add1 (most-positive-fixnum))))
(error? (fx- (sub1 (most-negative-fixnum)) 1))
(error? (fx- 1 (sub1 (most-negative-fixnum))))
(eqv? (fx-/wraparound (most-negative-fixnum) 1) (most-positive-fixnum))
(eqv? (fx-/wraparound (most-negative-fixnum) 2) (sub1 (most-positive-fixnum)))
(eqv? (fx-/wraparound (most-positive-fixnum) -1) (most-negative-fixnum))
(eqv? (fx-/wraparound (most-positive-fixnum) -2) (add1 (most-negative-fixnum)))
(eqv? (fx-/wraparound (most-positive-fixnum) (most-negative-fixnum)) -1)
(eqv? (fx-/wraparound (most-negative-fixnum) (most-positive-fixnum)) 1)
)
(mat fx*
(eqv? (fx* 3 0) 0)
(eqv? (fx* 3 1) 3)
@ -589,6 +623,24 @@
(test-cp0-expansion eqv? '(r6rs:fx* 3 3) 9)
)
(mat fx*/wraparound
(eqv? (fx*/wraparound 3 0) 0)
(eqv? (fx*/wraparound 3 1) 3)
(eqv? (fx*/wraparound -3 4) -12)
(error? (fx*/wraparound '(a . b) 0))
(error? (fx* (add1 (most-positive-fixnum)) 1))
(error? (fx* 1 (add1 (most-positive-fixnum))))
(error? (fx* (sub1 (most-negative-fixnum)) 1))
(error? (fx* 1 (sub1 (most-negative-fixnum))))
(eqv? (fx*/wraparound (most-negative-fixnum) -1) (most-negative-fixnum))
(eqv? (fx*/wraparound (most-negative-fixnum) 2) 0)
(eqv? (fx*/wraparound (most-positive-fixnum) -1) (add1 (most-negative-fixnum)))
(eqv? (fx*/wraparound (most-positive-fixnum) 2) -2)
(eqv? (fx*/wraparound (most-positive-fixnum) -2) 2)
(eqv? (fx*/wraparound (most-positive-fixnum) (most-negative-fixnum)) (most-negative-fixnum))
(eqv? (fx*/wraparound (most-negative-fixnum) (most-positive-fixnum)) (most-negative-fixnum))
)
(mat fxquotient
(eqv? (fxquotient 3 1) 3)
(eqv? (fxquotient 3 4) 0)
@ -1456,7 +1508,7 @@
(test-cp0-expansion eqv? '(fxsll 1 3) 8)
(test-cp0-expansion eqv? '(fxsll 1 4) 16)
(test-cp0-expansion eqv? '(fxsll 1 (/ 8 2)) 16)
)
)
(mat fxarithmetic-shift-left
; bound on shift count is one less than for fxsll
@ -1500,7 +1552,25 @@
(test-cp0-expansion eqv? '(fxarithmetic-shift-left 1 3) 8)
(test-cp0-expansion eqv? '(fxarithmetic-shift-left 1 4) 16)
(test-cp0-expansion eqv? '(fxarithmetic-shift-left 1 (/ 8 2)) 16)
)
)
(mat fsll/wraparound
(eqv? (fxsll/wraparound 3 0) 3)
(eqv? (fxsll/wraparound 3 1) 6)
(eqv? (fxsll/wraparound -3 4) -48)
(error? (fxsll/wraparound '(a . b) 0))
(error? (fxsll/wraparound 4 -3))
(error? (fxsll/wraparound 4 1000))
(error? (fxsll/wraparound 4 -1000))
(error? (fxsll (add1 (most-positive-fixnum)) 1))
(error? (fxsll 1 (add1 (most-positive-fixnum))))
(error? (fxsll (sub1 (most-negative-fixnum)) 1))
(error? (fxsll 1 (sub1 (most-negative-fixnum))))
(eqv? (fxsll/wraparound (most-negative-fixnum) 1) 0)
(eqv? (fxsll/wraparound (most-negative-fixnum) 30) 0)
(eqv? (fxsll/wraparound (most-positive-fixnum) 1) -2)
(eqv? (fxsll/wraparound (most-positive-fixnum) 5) -32)
)
(mat fxsrl
(error? (fxsrl 1 -1))

View File

@ -1,5 +1,5 @@
*** errors-compile-0-f-f-f 2020-11-07 07:25:50.000000000 -0700
--- errors-compile-0-f-t-f 2020-11-07 06:47:03.000000000 -0700
*** errors-compile-0-f-f-f 2020-11-19 11:38:38.000000000 -0700
--- errors-compile-0-f-t-f 2020-11-19 10:55:55.000000000 -0700
***************
*** 200,206 ****
3.mo:Expected error in mat dipa-letrec: "attempt to reference undefined variable a".
@ -379,3 +379,20 @@
record.mo:Expected error in mat r6rs-records-syntactic: "define-record-type: incompatible record type cpoint - different parent".
record.mo:Expected error in mat r6rs-records-syntactic: "define-record-type: incompatible record type cpoint - different parent".
record.mo:Expected error in mat r6rs-records-syntactic: "cannot extend define-record-type parent fratrat".
***************
*** 9128,9134 ****
fx.mo:Expected error in mat r6rs:fx+: "fx+: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
! fx.mo:Expected error in mat fx+/wraparound: "fx+/wraparound: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <-int> is not a fixnum".
--- 9128,9134 ----
fx.mo:Expected error in mat r6rs:fx+: "fx+: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
! fx.mo:Expected error in mat fx+/wraparound: "incorrect argument count in call (fx+/wraparound (quote (a . b)) 0)".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <-int> is not a fixnum".

View File

@ -1,5 +1,5 @@
*** errors-compile-0-f-f-f 2020-11-07 07:25:50.000000000 -0700
--- errors-compile-0-t-f-f 2020-11-07 06:55:58.000000000 -0700
*** errors-compile-0-f-f-f 2020-11-19 11:38:38.000000000 -0700
--- errors-compile-0-t-f-f 2020-11-19 11:05:19.000000000 -0700
***************
*** 168,174 ****
3.mo:Expected error in mat case-lambda: "incorrect number of arguments 2 to #<procedure foo>".
@ -5118,9 +5118,9 @@
fx.mo:Expected error in mat $fxu<: "incorrect number of arguments 3 to #<procedure $fxu<>".
fx.mo:Expected error in mat $fxu<: "$fxu<: <-int> is not a fixnum".
***************
*** 9141,9153 ****
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
*** 9151,9163 ****
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow with arguments <int> and 2".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -5132,9 +5132,9 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
--- 9141,9153 ----
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
--- 9151,9163 ----
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow computing (fx* <int> 2)".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -5147,7 +5147,7 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
***************
*** 9197,9209 ****
*** 9212,9224 ****
fx.mo:Expected error in mat fx1+: "fx1+: <-int> is not a fixnum".
fx.mo:Expected error in mat fx1+: "fx1+: <int> is not a fixnum".
fx.mo:Expected error in mat fx1+: "fx1+: a is not a fixnum".
@ -5161,7 +5161,7 @@
fx.mo:Expected error in mat fxmax: "fxmax: a is not a fixnum".
fx.mo:Expected error in mat fxmax: "fxmax: <int> is not a fixnum".
fx.mo:Expected error in mat fxmax: "fxmax: <-int> is not a fixnum".
--- 9197,9209 ----
--- 9212,9224 ----
fx.mo:Expected error in mat fx1+: "fx1+: <-int> is not a fixnum".
fx.mo:Expected error in mat fx1+: "fx1+: <int> is not a fixnum".
fx.mo:Expected error in mat fx1+: "fx1+: a is not a fixnum".
@ -5176,7 +5176,7 @@
fx.mo:Expected error in mat fxmax: "fxmax: <int> is not a fixnum".
fx.mo:Expected error in mat fxmax: "fxmax: <-int> is not a fixnum".
***************
*** 9301,9310 ****
*** 9324,9333 ****
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments <int> and 10".
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments -4097 and <int>".
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments <-int> and 1".
@ -5187,7 +5187,7 @@
fx.mo:Expected error in mat fxbit-field: "fxbit-field: 35.0 is not a fixnum".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: 5.0 is not a valid start index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: 8.0 is not a valid end index".
--- 9301,9310 ----
--- 9324,9333 ----
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments <int> and 10".
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments -4097 and <int>".
fx.mo:Expected error in mat fxarithmetic-shift: "fxarithmetic-shift: fixnum overflow with arguments <-int> and 1".
@ -5199,7 +5199,7 @@
fx.mo:Expected error in mat fxbit-field: "fxbit-field: 5.0 is not a valid start index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: 8.0 is not a valid end index".
***************
*** 9318,9351 ****
*** 9341,9374 ****
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid end index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid start index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid end index".
@ -5234,7 +5234,7 @@
fx.mo:Expected error in mat fxif: "fxif: a is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: 3.4 is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: (a) is not a fixnum".
--- 9318,9351 ----
--- 9341,9374 ----
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid end index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid start index".
fx.mo:Expected error in mat fxbit-field: "fxbit-field: <int> is not a valid end index".
@ -5270,7 +5270,7 @@
fx.mo:Expected error in mat fxif: "fxif: 3.4 is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: (a) is not a fixnum".
***************
*** 9355,9398 ****
*** 9378,9421 ****
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
@ -5315,7 +5315,7 @@
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: 3.4 is not a fixnum".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: "3" is not a fixnum".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: <int> is not a fixnum".
--- 9355,9398 ----
--- 9378,9421 ----
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
fx.mo:Expected error in mat fxif: "fxif: <-int> is not a fixnum".
@ -5361,7 +5361,7 @@
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: "3" is not a fixnum".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: <int> is not a fixnum".
***************
*** 9401,9411 ****
*** 9424,9434 ****
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index -1".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index <int>".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index <int>".
@ -5373,7 +5373,7 @@
fx.mo:Expected error in mat fxcopy-bit-field: "fxcopy-bit-field: "3" is not a fixnum".
fx.mo:Expected error in mat fxcopy-bit-field: "fxcopy-bit-field: 3.4 is not a valid start index".
fx.mo:Expected error in mat fxcopy-bit-field: "fxcopy-bit-field: 3/4 is not a valid end index".
--- 9401,9411 ----
--- 9424,9434 ----
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index -1".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index <int>".
fx.mo:Expected error in mat fxcopy-bit: "fxcopy-bit: invalid bit index <int>".
@ -5386,7 +5386,7 @@
fx.mo:Expected error in mat fxcopy-bit-field: "fxcopy-bit-field: 3.4 is not a valid start index".
fx.mo:Expected error in mat fxcopy-bit-field: "fxcopy-bit-field: 3/4 is not a valid end index".
***************
*** 9465,9474 ****
*** 9488,9497 ****
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: (a) is not a fixnum".
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: undefined for 0".
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: undefined for 0".
@ -5397,7 +5397,7 @@
fx.mo:Expected error in mat fx+/carry: "fx+/carry: 1.0 is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: 3.0 is not a fixnum".
--- 9465,9474 ----
--- 9488,9497 ----
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: (a) is not a fixnum".
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: undefined for 0".
fx.mo:Expected error in mat fxdiv0-and-mod0: "fxmod0: undefined for 0".
@ -5409,7 +5409,7 @@
fx.mo:Expected error in mat fx+/carry: "fx+/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: 3.0 is not a fixnum".
***************
*** 9484,9493 ****
*** 9507,9516 ****
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
@ -5420,7 +5420,7 @@
fx.mo:Expected error in mat fx-/carry: "fx-/carry: 1.0 is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: 3.0 is not a fixnum".
--- 9484,9493 ----
--- 9507,9516 ----
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx+/carry: "fx+/carry: <-int> is not a fixnum".
@ -5432,7 +5432,7 @@
fx.mo:Expected error in mat fx-/carry: "fx-/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: 3.0 is not a fixnum".
***************
*** 9503,9512 ****
*** 9526,9535 ****
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
@ -5443,7 +5443,7 @@
fx.mo:Expected error in mat fx*/carry: "fx*/carry: 1.0 is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: 3.0 is not a fixnum".
--- 9503,9512 ----
--- 9526,9535 ----
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/carry: "fx-/carry: <-int> is not a fixnum".
@ -5455,7 +5455,7 @@
fx.mo:Expected error in mat fx*/carry: "fx*/carry: 2.0 is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: 3.0 is not a fixnum".
***************
*** 9522,9532 ****
*** 9545,9555 ****
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
@ -5467,7 +5467,7 @@
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: a is not a fixnum".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid start index 0.0".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index 2.0".
--- 9522,9532 ----
--- 9545,9555 ----
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*/carry: "fx*/carry: <-int> is not a fixnum".
@ -5480,7 +5480,7 @@
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid start index 0.0".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index 2.0".
***************
*** 9549,9558 ****
*** 9572,9581 ****
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: count 1 is greater than difference between end index 5 and start index 5".
@ -5491,7 +5491,7 @@
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: a is not a fixnum".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid start index 0.0".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index 2.0".
--- 9549,9558 ----
--- 9572,9581 ----
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxrotate-bit-field: "fxrotate-bit-field: count 1 is greater than difference between end index 5 and start index 5".
@ -5503,7 +5503,7 @@
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid start index 0.0".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index 2.0".
***************
*** 9568,9585 ****
*** 9591,9608 ****
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index <-int>".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: start index 7 is greater than end index 5".
@ -5522,7 +5522,7 @@
fl.mo:Expected error in mat fl=: "fl=: (a) is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: a is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: a is not a flonum".
--- 9568,9585 ----
--- 9591,9608 ----
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index <int>".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: invalid end index <-int>".
fx.mo:Expected error in mat fxreverse-bit-field: "fxreverse-bit-field: start index 7 is greater than end index 5".
@ -5542,7 +5542,7 @@
fl.mo:Expected error in mat fl=: "fl=: a is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: a is not a flonum".
***************
*** 9587,9593 ****
*** 9610,9616 ****
fl.mo:Expected error in mat fl=: "fl=: 3 is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: 7/2 is not a flonum".
@ -5550,7 +5550,7 @@
fl.mo:Expected error in mat fl<: "fl<: (a) is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: a is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: a is not a flonum".
--- 9587,9593 ----
--- 9610,9616 ----
fl.mo:Expected error in mat fl=: "fl=: 3 is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl=: "fl=: 7/2 is not a flonum".
@ -5559,7 +5559,7 @@
fl.mo:Expected error in mat fl<: "fl<: a is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: a is not a flonum".
***************
*** 9595,9601 ****
*** 9618,9624 ****
fl.mo:Expected error in mat fl<: "fl<: 3 is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: 7/2 is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: 7/2 is not a flonum".
@ -5567,7 +5567,7 @@
fl.mo:Expected error in mat fl>: "fl>: (a) is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: a is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: a is not a flonum".
--- 9595,9601 ----
--- 9618,9624 ----
fl.mo:Expected error in mat fl<: "fl<: 3 is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: 7/2 is not a flonum".
fl.mo:Expected error in mat fl<: "fl<: 7/2 is not a flonum".
@ -5576,7 +5576,7 @@
fl.mo:Expected error in mat fl>: "fl>: a is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: a is not a flonum".
***************
*** 9603,9609 ****
*** 9626,9632 ****
fl.mo:Expected error in mat fl>: "fl>: 3 is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: 7/2 is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: 7/2 is not a flonum".
@ -5584,7 +5584,7 @@
fl.mo:Expected error in mat fl<=: "fl<=: (a) is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: a is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: a is not a flonum".
--- 9603,9609 ----
--- 9626,9632 ----
fl.mo:Expected error in mat fl>: "fl>: 3 is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: 7/2 is not a flonum".
fl.mo:Expected error in mat fl>: "fl>: 7/2 is not a flonum".
@ -5593,7 +5593,7 @@
fl.mo:Expected error in mat fl<=: "fl<=: a is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: a is not a flonum".
***************
*** 9611,9617 ****
*** 9634,9640 ****
fl.mo:Expected error in mat fl<=: "fl<=: 3 is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: 7/2 is not a flonum".
@ -5601,7 +5601,7 @@
fl.mo:Expected error in mat fl>=: "fl>=: (a) is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: a is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: a is not a flonum".
--- 9611,9617 ----
--- 9634,9640 ----
fl.mo:Expected error in mat fl<=: "fl<=: 3 is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl<=: "fl<=: 7/2 is not a flonum".
@ -5610,7 +5610,7 @@
fl.mo:Expected error in mat fl>=: "fl>=: a is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: a is not a flonum".
***************
*** 9619,9658 ****
*** 9642,9681 ****
fl.mo:Expected error in mat fl>=: "fl>=: 3 is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: 7/2 is not a flonum".
@ -5651,7 +5651,7 @@
fl.mo:Expected error in mat fl>=?: "fl>=?: a is not a flonum".
fl.mo:Expected error in mat fl>=?: "fl>=?: a is not a flonum".
fl.mo:Expected error in mat fl>=?: "fl>=?: 3 is not a flonum".
--- 9619,9658 ----
--- 9642,9681 ----
fl.mo:Expected error in mat fl>=: "fl>=: 3 is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: 7/2 is not a flonum".
fl.mo:Expected error in mat fl>=: "fl>=: 7/2 is not a flonum".
@ -5693,7 +5693,7 @@
fl.mo:Expected error in mat fl>=?: "fl>=?: a is not a flonum".
fl.mo:Expected error in mat fl>=?: "fl>=?: 3 is not a flonum".
***************
*** 9662,9668 ****
*** 9685,9691 ****
fl.mo:Expected error in mat fl+: "fl+: (a . b) is not a flonum".
fl.mo:Expected error in mat fl+: "fl+: 1 is not a flonum".
fl.mo:Expected error in mat fl+: "fl+: 2/3 is not a flonum".
@ -5701,7 +5701,7 @@
fl.mo:Expected error in mat fl-: "fl-: (a . b) is not a flonum".
fl.mo:Expected error in mat fl-: "fl-: 1 is not a flonum".
fl.mo:Expected error in mat fl-: "fl-: a is not a flonum".
--- 9662,9668 ----
--- 9685,9691 ----
fl.mo:Expected error in mat fl+: "fl+: (a . b) is not a flonum".
fl.mo:Expected error in mat fl+: "fl+: 1 is not a flonum".
fl.mo:Expected error in mat fl+: "fl+: 2/3 is not a flonum".
@ -5710,7 +5710,7 @@
fl.mo:Expected error in mat fl-: "fl-: 1 is not a flonum".
fl.mo:Expected error in mat fl-: "fl-: a is not a flonum".
***************
*** 9672,9761 ****
*** 9695,9784 ****
fl.mo:Expected error in mat fl*: "fl*: (a . b) is not a flonum".
fl.mo:Expected error in mat fl*: "fl*: 1 is not a flonum".
fl.mo:Expected error in mat fl*: "fl*: 2/3 is not a flonum".
@ -5801,7 +5801,7 @@
fl.mo:Expected error in mat flsingle: "flsingle: a is not a flonum".
fl.mo:Expected error in mat flsingle: "flsingle: 3 is not a flonum".
fl.mo:Expected error in mat flsingle: "flsingle: 2.0+1.0i is not a flonum".
--- 9672,9761 ----
--- 9695,9784 ----
fl.mo:Expected error in mat fl*: "fl*: (a . b) is not a flonum".
fl.mo:Expected error in mat fl*: "fl*: 1 is not a flonum".
fl.mo:Expected error in mat fl*: "fl*: 2/3 is not a flonum".
@ -5893,7 +5893,7 @@
fl.mo:Expected error in mat flsingle: "flsingle: 3 is not a flonum".
fl.mo:Expected error in mat flsingle: "flsingle: 2.0+1.0i is not a flonum".
***************
*** 9774,9809 ****
*** 9797,9832 ****
fl.mo:Expected error in mat flinfinite?: "flinfinite?: 3 is not a flonum".
fl.mo:Expected error in mat flinfinite?: "flinfinite?: 3/4 is not a flonum".
fl.mo:Expected error in mat flinfinite?: "flinfinite?: hi is not a flonum".
@ -5930,7 +5930,7 @@
fl.mo:Expected error in mat fleven?: "fleven?: a is not a flonum".
fl.mo:Expected error in mat fleven?: "fleven?: 3 is not a flonum".
fl.mo:Expected error in mat fleven?: "fleven?: 3.2 is not an integer".
--- 9774,9809 ----
--- 9797,9832 ----
fl.mo:Expected error in mat flinfinite?: "flinfinite?: 3 is not a flonum".
fl.mo:Expected error in mat flinfinite?: "flinfinite?: 3/4 is not a flonum".
fl.mo:Expected error in mat flinfinite?: "flinfinite?: hi is not a flonum".
@ -5968,7 +5968,7 @@
fl.mo:Expected error in mat fleven?: "fleven?: 3 is not a flonum".
fl.mo:Expected error in mat fleven?: "fleven?: 3.2 is not an integer".
***************
*** 9811,9818 ****
*** 9834,9841 ****
fl.mo:Expected error in mat fleven?: "fleven?: 1+1i is not a flonum".
fl.mo:Expected error in mat fleven?: "fleven?: +inf.0 is not an integer".
fl.mo:Expected error in mat fleven?: "fleven?: +nan.0 is not an integer".
@ -5977,7 +5977,7 @@
fl.mo:Expected error in mat flodd?: "flodd?: a is not a flonum".
fl.mo:Expected error in mat flodd?: "flodd?: 3 is not a flonum".
fl.mo:Expected error in mat flodd?: "flodd?: 3.2 is not an integer".
--- 9811,9818 ----
--- 9834,9841 ----
fl.mo:Expected error in mat fleven?: "fleven?: 1+1i is not a flonum".
fl.mo:Expected error in mat fleven?: "fleven?: +inf.0 is not an integer".
fl.mo:Expected error in mat fleven?: "fleven?: +nan.0 is not an integer".
@ -5987,7 +5987,7 @@
fl.mo:Expected error in mat flodd?: "flodd?: 3 is not a flonum".
fl.mo:Expected error in mat flodd?: "flodd?: 3.2 is not an integer".
***************
*** 9820,9826 ****
*** 9843,9849 ****
fl.mo:Expected error in mat flodd?: "flodd?: 3+1i is not a flonum".
fl.mo:Expected error in mat flodd?: "flodd?: +inf.0 is not an integer".
fl.mo:Expected error in mat flodd?: "flodd?: +nan.0 is not an integer".
@ -5995,7 +5995,7 @@
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
--- 9820,9826 ----
--- 9843,9849 ----
fl.mo:Expected error in mat flodd?: "flodd?: 3+1i is not a flonum".
fl.mo:Expected error in mat flodd?: "flodd?: +inf.0 is not an integer".
fl.mo:Expected error in mat flodd?: "flodd?: +nan.0 is not an integer".
@ -6004,7 +6004,7 @@
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
***************
*** 9828,9834 ****
*** 9851,9857 ****
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: 0.0+1.0i is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: 0+1i is not a flonum".
@ -6012,7 +6012,7 @@
fl.mo:Expected error in mat flmax: "flmax: a is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: a is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 3 is not a flonum".
--- 9828,9834 ----
--- 9851,9857 ----
fl.mo:Expected error in mat flmin: "flmin: a is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: 0.0+1.0i is not a flonum".
fl.mo:Expected error in mat flmin: "flmin: 0+1i is not a flonum".
@ -6021,7 +6021,7 @@
fl.mo:Expected error in mat flmax: "flmax: a is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 3 is not a flonum".
***************
*** 9836,9849 ****
*** 9859,9872 ****
fl.mo:Expected error in mat flmax: "flmax: a is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 0.0+1.0i is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 0+1i is not a flonum".
@ -6036,7 +6036,7 @@
fl.mo:Expected error in mat fldenominator: "fldenominator: a is not a flonum".
fl.mo:Expected error in mat fldenominator: "fldenominator: 3 is not a flonum".
fl.mo:Expected error in mat fldenominator: "fldenominator: 0+1i is not a flonum".
--- 9836,9849 ----
--- 9859,9872 ----
fl.mo:Expected error in mat flmax: "flmax: a is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 0.0+1.0i is not a flonum".
fl.mo:Expected error in mat flmax: "flmax: 0+1i is not a flonum".
@ -6052,7 +6052,7 @@
fl.mo:Expected error in mat fldenominator: "fldenominator: 3 is not a flonum".
fl.mo:Expected error in mat fldenominator: "fldenominator: 0+1i is not a flonum".
***************
*** 9889,9895 ****
*** 9912,9918 ****
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
@ -6060,7 +6060,7 @@
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
--- 9889,9895 ----
--- 9912,9918 ----
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
@ -6069,7 +6069,7 @@
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
cfl.mo:Expected error in mat cfl-: "cfl-: a is not a cflonum".
***************
*** 9899,9912 ****
*** 9922,9935 ****
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
@ -6084,7 +6084,7 @@
foreign.mo:Expected error in mat load-shared-object: "load-shared-object: invalid path 3".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: no entry for "i do not exist"".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: no entry for "i do not exist"".
--- 9899,9912 ----
--- 9922,9935 ----
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
cfl.mo:Expected error in mat cfl/: "cfl/: a is not a cflonum".
@ -6100,7 +6100,7 @@
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: no entry for "i do not exist"".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: no entry for "i do not exist"".
***************
*** 9941,9948 ****
*** 9964,9971 ****
foreign.mo:Expected error in mat foreign-procedure: "id: invalid foreign-procedure argument foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle abcde".
foreign.mo:Expected error in mat foreign-procedure: "float_id: invalid foreign-procedure argument 0".
@ -6109,7 +6109,7 @@
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier i-am-not-a-type".
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier 1".
foreign.mo:Expected error in mat foreign-bytevectors: "u8*->u8*: invalid foreign-procedure argument "hello"".
--- 9941,9948 ----
--- 9964,9971 ----
foreign.mo:Expected error in mat foreign-procedure: "id: invalid foreign-procedure argument foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle abcde".
foreign.mo:Expected error in mat foreign-procedure: "float_id: invalid foreign-procedure argument 0".
@ -6119,7 +6119,7 @@
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier 1".
foreign.mo:Expected error in mat foreign-bytevectors: "u8*->u8*: invalid foreign-procedure argument "hello"".
***************
*** 10441,10453 ****
*** 10464,10476 ****
unix.mo:Expected error in mat file-operations: "file-access-time: failed for "testlink": no such file or directory".
unix.mo:Expected error in mat file-operations: "file-change-time: failed for "testlink": no such file or directory".
unix.mo:Expected error in mat file-operations: "file-modification-time: failed for "testlink": no such file or directory".
@ -6133,7 +6133,7 @@
windows.mo:Expected error in mat registry: "get-registry: pooh is not a string".
windows.mo:Expected error in mat registry: "put-registry!: 3 is not a string".
windows.mo:Expected error in mat registry: "put-registry!: 3 is not a string".
--- 10441,10453 ----
--- 10464,10476 ----
unix.mo:Expected error in mat file-operations: "file-access-time: failed for "testlink": no such file or directory".
unix.mo:Expected error in mat file-operations: "file-change-time: failed for "testlink": no such file or directory".
unix.mo:Expected error in mat file-operations: "file-modification-time: failed for "testlink": no such file or directory".
@ -6148,7 +6148,7 @@
windows.mo:Expected error in mat registry: "put-registry!: 3 is not a string".
windows.mo:Expected error in mat registry: "put-registry!: 3 is not a string".
***************
*** 10475,10546 ****
*** 10498,10569 ****
ieee.mo:Expected error in mat flonum->fixnum: "flonum->fixnum: result for -inf.0 would be outside of fixnum range".
ieee.mo:Expected error in mat flonum->fixnum: "flonum->fixnum: result for +nan.0 would be outside of fixnum range".
ieee.mo:Expected error in mat fllp: "fllp: 3 is not a flonum".
@ -6221,7 +6221,7 @@
date.mo:Expected error in mat time: "time>=?: 3 is not a time record".
date.mo:Expected error in mat time: "time>=?: #<procedure car> is not a time record".
date.mo:Expected error in mat time: "time>=?: types of <time> and <time> differ".
--- 10475,10546 ----
--- 10498,10569 ----
ieee.mo:Expected error in mat flonum->fixnum: "flonum->fixnum: result for -inf.0 would be outside of fixnum range".
ieee.mo:Expected error in mat flonum->fixnum: "flonum->fixnum: result for +nan.0 would be outside of fixnum range".
ieee.mo:Expected error in mat fllp: "fllp: 3 is not a flonum".
@ -6295,7 +6295,7 @@
date.mo:Expected error in mat time: "time>=?: #<procedure car> is not a time record".
date.mo:Expected error in mat time: "time>=?: types of <time> and <time> differ".
***************
*** 10548,10561 ****
*** 10571,10584 ****
date.mo:Expected error in mat time: "add-duration: <time> does not have type time-duration".
date.mo:Expected error in mat time: "subtract-duration: <time> does not have type time-duration".
date.mo:Expected error in mat time: "copy-time: <date> is not a time record".
@ -6310,7 +6310,7 @@
date.mo:Expected error in mat date: "make-date: invalid nanosecond -1".
date.mo:Expected error in mat date: "make-date: invalid nanosecond <int>".
date.mo:Expected error in mat date: "make-date: invalid nanosecond zero".
--- 10548,10561 ----
--- 10571,10584 ----
date.mo:Expected error in mat time: "add-duration: <time> does not have type time-duration".
date.mo:Expected error in mat time: "subtract-duration: <time> does not have type time-duration".
date.mo:Expected error in mat time: "copy-time: <date> is not a time record".
@ -6326,7 +6326,7 @@
date.mo:Expected error in mat date: "make-date: invalid nanosecond <int>".
date.mo:Expected error in mat date: "make-date: invalid nanosecond zero".
***************
*** 10581,10641 ****
*** 10604,10664 ****
date.mo:Expected error in mat date: "make-date: invalid time-zone offset 90000".
date.mo:Expected error in mat date: "make-date: invalid time-zone offset est".
date.mo:Expected error in mat date: "make-date: invalid time-zone offset "est"".
@ -6388,7 +6388,7 @@
date.mo:Expected error in mat date: "current-date: invalid time-zone offset -90000".
date.mo:Expected error in mat date: "current-date: invalid time-zone offset 90000".
date.mo:Expected error in mat conversions/sleep: "date->time-utc: <time> is not a date record".
--- 10581,10641 ----
--- 10604,10664 ----
date.mo:Expected error in mat date: "make-date: invalid time-zone offset 90000".
date.mo:Expected error in mat date: "make-date: invalid time-zone offset est".
date.mo:Expected error in mat date: "make-date: invalid time-zone offset "est"".

View File

@ -1,5 +1,5 @@
*** errors-compile-0-f-f-f 2020-11-07 07:25:50.000000000 -0700
--- errors-interpret-0-f-f-f 2020-11-07 07:05:50.000000000 -0700
*** errors-compile-0-f-f-f 2020-11-19 11:38:38.000000000 -0700
--- errors-interpret-0-f-f-f 2020-11-19 11:16:11.000000000 -0700
***************
*** 18,25 ****
primvars.mo:Expected error testing (environment (quote (chezscheme)) (quote (chezscheme)) (quote #f)): Exception in environment: invalid library reference #f
@ -260,9 +260,9 @@
record.mo:Expected error in mat r6rs-records-procedural: "make-record-constructor-descriptor: record constructor descriptor #<record constructor descriptor> is not for parent of record type #<record type grand-child>".
record.mo:Expected error in mat r6rs-records-procedural: "make-record-type-descriptor: cannot extend sealed record type #<record type bar>".
***************
*** 9141,9153 ****
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
*** 9151,9163 ****
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow with arguments <int> and 2".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -274,9 +274,9 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
--- 9141,9153 ----
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
--- 9151,9163 ----
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow computing (fx* <int> 2)".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -289,7 +289,7 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
***************
*** 9914,9938 ****
*** 9937,9961 ****
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
@ -315,7 +315,7 @@
foreign.mo:Expected error in mat foreign-procedure: "invalid foreign-procedure argument type specifier booleen".
foreign.mo:Expected error in mat foreign-procedure: "invalid foreign-procedure argument type specifier integer-34".
foreign.mo:Expected error in mat foreign-procedure: "invalid foreign-procedure result type specifier chare".
--- 9914,9938 ----
--- 9937,9961 ----
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
foreign.mo:Expected error in mat foreign-procedure: "foreign-procedure: invalid foreign procedure handle foo".
@ -342,7 +342,7 @@
foreign.mo:Expected error in mat foreign-procedure: "invalid foreign-procedure argument type specifier integer-34".
foreign.mo:Expected error in mat foreign-procedure: "invalid foreign-procedure result type specifier chare".
***************
*** 9945,9976 ****
*** 9968,9999 ****
foreign.mo:Expected error in mat foreign-sizeof: "incorrect argument count in call (foreign-sizeof (quote int) (quote int))".
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier i-am-not-a-type".
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier 1".
@ -375,7 +375,7 @@
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
--- 9945,9976 ----
--- 9968,9999 ----
foreign.mo:Expected error in mat foreign-sizeof: "incorrect argument count in call (foreign-sizeof (quote int) (quote int))".
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier i-am-not-a-type".
foreign.mo:Expected error in mat foreign-sizeof: "foreign-sizeof: invalid foreign type specifier 1".
@ -409,7 +409,7 @@
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
***************
*** 9978,10003 ****
*** 10001,10026 ****
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
@ -436,7 +436,7 @@
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
--- 9978,10003 ----
--- 10001,10026 ----
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
foreign.mo:Expected error in mat foreign-strings: "foreign-callable: invalid return value ("ello" 4) from #<procedure>".
@ -464,7 +464,7 @@
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
***************
*** 10009,10043 ****
*** 10032,10066 ****
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
@ -500,7 +500,7 @@
foreign.mo:Expected error in mat foreign-C-types: "foreign-callable: invalid return value (73 74) from #<procedure>".
foreign.mo:Expected error in mat foreign-C-types: "foreign-callable: invalid return value (73 74) from #<procedure>".
foreign.mo:Expected error in mat foreign-C-types: "foreign-callable: invalid return value (73 74) from #<procedure>".
--- 10009,10043 ----
--- 10032,10066 ----
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
foreign.mo:Expected error in mat foreign-fixed-types: "foreign-callable: invalid return value (- x 7) from #<procedure>".
@ -537,7 +537,7 @@
foreign.mo:Expected error in mat foreign-C-types: "foreign-callable: invalid return value (73 74) from #<procedure>".
foreign.mo:Expected error in mat foreign-C-types: "foreign-callable: invalid return value (73 74) from #<procedure>".
***************
*** 10644,10653 ****
*** 10667,10676 ****
exceptions.mo:Expected error in mat assert: "failed assertion (memq (quote b) (quote (1 2 a 3 4)))".
exceptions.mo:Expected error in mat assert: "failed assertion (q ...)".
exceptions.mo:Expected error in mat assert: "failed assertion (andmap symbol? (syntax (x ...)))".
@ -548,7 +548,7 @@
oop.mo:Expected error in mat oop: "m1: not applicable to 17".
oop.mo:Expected error in mat oop: "variable <a>-x1 is not bound".
oop.mo:Expected error in mat oop: "variable <a>-x1-set! is not bound".
--- 10644,10653 ----
--- 10667,10676 ----
exceptions.mo:Expected error in mat assert: "failed assertion (memq (quote b) (quote (1 2 a 3 4)))".
exceptions.mo:Expected error in mat assert: "failed assertion (q ...)".
exceptions.mo:Expected error in mat assert: "failed assertion (andmap symbol? (syntax (x ...)))".

View File

@ -1,5 +1,5 @@
*** errors-compile-0-f-t-f 2020-11-07 06:47:03.000000000 -0700
--- errors-interpret-0-f-t-f 2020-11-07 07:16:02.000000000 -0700
*** errors-compile-0-f-t-f 2020-11-19 10:55:55.000000000 -0700
--- errors-interpret-0-f-t-f 2020-11-19 11:27:36.000000000 -0700
***************
*** 18,25 ****
primvars.mo:Expected error testing (environment (quote (chezscheme)) (quote (chezscheme)) (quote #f)): Exception in environment: invalid library reference #f
@ -504,9 +504,9 @@
record.mo:Expected error in mat r6rs-records-syntactic: "define-record-type: incompatible record type cpoint - different parent".
record.mo:Expected error in mat r6rs-records-syntactic: "cannot extend define-record-type parent fratrat".
***************
*** 9141,9153 ****
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
*** 9151,9163 ****
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow with arguments <int> and 2".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -518,9 +518,9 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
--- 9141,9153 ----
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
--- 9151,9163 ----
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
! fx.mo:Expected error in mat fx*: "fx*: fixnum overflow computing (fx* <int> 2)".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -533,7 +533,7 @@
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
***************
*** 10644,10653 ****
*** 10667,10676 ****
exceptions.mo:Expected error in mat assert: "failed assertion (memq (quote b) (quote (1 2 a 3 4)))".
exceptions.mo:Expected error in mat assert: "failed assertion (q ...)".
exceptions.mo:Expected error in mat assert: "failed assertion (andmap symbol? (syntax (x ...)))".
@ -544,7 +544,7 @@
oop.mo:Expected error in mat oop: "m1: not applicable to 17".
oop.mo:Expected error in mat oop: "variable <a>-x1 is not bound".
oop.mo:Expected error in mat oop: "variable <a>-x1-set! is not bound".
--- 10644,10653 ----
--- 10667,10676 ----
exceptions.mo:Expected error in mat assert: "failed assertion (memq (quote b) (quote (1 2 a 3 4)))".
exceptions.mo:Expected error in mat assert: "failed assertion (q ...)".
exceptions.mo:Expected error in mat assert: "failed assertion (andmap symbol? (syntax (x ...)))".

View File

@ -9128,6 +9128,11 @@ fx.mo:Expected error in mat r6rs:fx+: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx+: "fx+: #f is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+/wraparound: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <-int> is not a fixnum".
fx.mo:Expected error in mat fx+/wraparound: "fx+: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-: "fx-: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx-: "fx-: fixnum overflow with arguments <-int> and 1".
fx.mo:Expected error in mat fx-: "fx-: <int> is not a fixnum".
@ -9140,6 +9145,11 @@ fx.mo:Expected error in mat r6rs:fx-: "fx-: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx-: "fx-: #f is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-/wraparound: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx-/wraparound: "fx-: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx*: "fx*: fixnum overflow with arguments <int> and 2".
fx.mo:Expected error in mat fx*: "fx*: <int> is not a fixnum".
@ -9152,6 +9162,11 @@ fx.mo:Expected error in mat r6rs:fx*: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
fx.mo:Expected error in mat r6rs:fx*: "fx*: #f is not a fixnum".
fx.mo:Expected error in mat fx*/wraparound: "fx*/wraparound: (a . b) is not a fixnum".
fx.mo:Expected error in mat fx*/wraparound: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat fx*/wraparound: "fx*: <int> is not a fixnum".
fx.mo:Expected error in mat fx*/wraparound: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat fx*/wraparound: "fx*: <-int> is not a fixnum".
fx.mo:Expected error in mat fxquotient: "fxquotient: (a . b) is not a fixnum".
fx.mo:Expected error in mat fxquotient: "fxquotient: attempt to divide by zero".
fx.mo:Expected error in mat fxquotient: "fxquotient: <int> is not a fixnum".
@ -9272,6 +9287,14 @@ fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: f
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: fixnum overflow with arguments <int> and 10".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: fixnum overflow with arguments -4097 and <int>".
fx.mo:Expected error in mat fxarithmetic-shift-left: "fxarithmetic-shift-left: fixnum overflow with arguments <-int> and 1".
fx.mo:Expected error in mat fsll/wraparound: "fxsll/wraparound: (a . b) is not a fixnum".
fx.mo:Expected error in mat fsll/wraparound: "fxsll/wraparound: invalid shift count -3".
fx.mo:Expected error in mat fsll/wraparound: "fxsll/wraparound: invalid shift count 1000".
fx.mo:Expected error in mat fsll/wraparound: "fxsll/wraparound: invalid shift count -1000".
fx.mo:Expected error in mat fsll/wraparound: "fxsll: <int> is not a fixnum".
fx.mo:Expected error in mat fsll/wraparound: "fxsll: <int> is not a fixnum".
fx.mo:Expected error in mat fsll/wraparound: "fxsll: <-int> is not a fixnum".
fx.mo:Expected error in mat fsll/wraparound: "fxsll: <-int> is not a fixnum".
fx.mo:Expected error in mat fxsrl: "fxsrl: invalid shift count -1".
fx.mo:Expected error in mat fxsrl: "fxsrl: invalid shift count <int>".
fx.mo:Expected error in mat fxsrl: "fxsrl: a is not a fixnum".

View File

@ -25,7 +25,9 @@
(only-in "r6rs-lang.rkt"
make-record-constructor-descriptor
set-car!
set-cdr!)
set-cdr!
most-positive-fixnum
most-negative-fixnum)
(submod "r6rs-lang.rkt" hash-pair)
(for-syntax "scheme-struct.rkt"
"rcd.rkt"))
@ -177,11 +179,10 @@
[write-string display-string]
[call/ec call/1cc]
[s:string->symbol string->symbol])
;; Wraparound behavior not needed to compile Chez Scheme itself:
(rename-out [fx+ fx+/wraparound]
[fx- fx-/wraparound]
[fx* fx*/wraparound]
[fxlshift fxsll/wraparound])
fx+/wraparound
fx-/wraparound
fx*/wraparound
fxsll/wraparound
logbit? logbit1 logbit0 logtest
(rename-out [logbit? fxlogbit?]
[logbit1 fxlogbit1]
@ -829,6 +830,25 @@
(define (fxbit-field fx1 fx2 fx3)
(fxrshift (fxand fx1 (fxnot (fxlshift -1 fx3))) fx2))
(define (wraparound v)
(cond
[(fixnum? v)
v]
[(zero? (bitwise-and v (add1 (most-positive-fixnum))))
(bitwise-ior v (- -1 (most-positive-fixnum)))]
[else
(bitwise-and v (most-positive-fixnum))]))
;; Re-implement wraparound so we can use Racket v7.9 and earlier:
(define (fx+/wraparound x y)
(wraparound (+ x y)))
(define (fx-/wraparound x y)
(wraparound (- x y)))
(define (fx*/wraparound x y)
(wraparound (* x y)))
(define (fxsll/wraparound x y)
(wraparound (arithmetic-shift x y)))
(define (bitwise-bit-count fx)
(cond
[(eqv? fx 0) 0]

View File

@ -2742,7 +2742,7 @@
(partial-folder minus - - 0)
(partial-folder minus fx- - 0)
(r6rs-fixnum-partial-folder minus r6rs:fx- fx- - 0)
(r6rs-fixnum-partial-folder plus fx-/wraparound fx-/wraparound - 0 (lambda (x) #f) 3)
(r6rs-fixnum-partial-folder minus fx-/wraparound fx-/wraparound - 0)
(partial-folder minus fl- fl- -0.0)
(partial-folder minus cfl- cfl- -0.0)

View File

@ -445,7 +445,7 @@ Documentation notes:
[(flonum? z) ($flhash z)]
[(bignum? z) (let ([len (integer-length z)]
[update (lambda (hc k)
(let ([hc2 (#3%fx+ hc (#3%fxsll (#3%fx+ hc k) 10))])
(let ([hc2 (fx+/wraparound hc (fxsll/wraparound (fx+/wraparound hc k) 10))])
(fxlogxor hc2 (fxsrl hc2 6))))])
(let loop ([i 0] [hc 0])
(cond
@ -1004,7 +1004,7 @@ Documentation notes:
(define (hcabs hc) (if (fx< hc 0) (fxnot hc) hc))
(define (update hc k)
(let ([hc2 (#3%fx+ hc (#3%fxsll (#3%fx+ hc k) 10))])
(let ([hc2 (fx+/wraparound hc (fxsll/wraparound (fx+/wraparound hc k) 10))])
(fxlogxor hc2 (fxsrl hc2 6))))
(define bytevector-hash

View File

@ -55,15 +55,9 @@
;; Mostly copied from Chez Scheme's "newhash.ss":
(define number-hash
(lambda (z)
(let* ([+/fx
(lambda (hc k)
(#3%fx+ hc k))]
[sll/fx
(lambda (hc i)
(#3%fxsll hc i))]
[mix
(let* ([mix
(lambda (hc)
(let ([hc2 (+/fx hc (sll/fx hc 10))])
(let ([hc2 (fx+/wraparound hc (fxsll/wraparound hc 10))])
(fxlogxor hc2 (fxsrl hc2 6))))])
(cond
[(fixnum? z) (if (fx< z 0) (fxand z (most-positive-fixnum)) z)]
@ -75,8 +69,8 @@
[else
(let ([next-i (fx+ i (fx- (fixnum-width) 1))])
(loop next-i
(+/fx (bitwise-bit-field z i next-i)
(mix hc))))])))]
(fx+/wraparound (bitwise-bit-field z i next-i)
(mix hc))))])))]
[(ratnum? z) (number-hash (+ (* (numerator z) 5) (denominator z)))]
[else (logand (logxor (lognot (number-hash (real-part z))) (number-hash (imag-part z)))
(most-positive-fixnum))]))))
@ -123,39 +117,33 @@
(define MAX-HASH-BURN 128)
(define (equal-hash-loop x burn hc)
(let* ([+/fx
(lambda (hc k)
(#3%fx+ hc k))]
[sll/fx
(lambda (hc i)
(#3%fxsll hc i))]
[->fx
(let* ([->fx
(lambda (v)
(if (fixnum? v)
v
(modulo v (greatest-fixnum))))]
[mix1
(lambda (hc)
(let ([hc2 (+/fx hc (sll/fx hc 10))])
(let ([hc2 (fx+/wraparound hc (fxsll/wraparound hc 10))])
(fxlogxor hc2 (fxsrl hc2 6))))]
[mix2
(lambda (hc)
(mix1 hc))])
(cond
[(fx> burn MAX-HASH-BURN) (values hc burn)]
[(boolean? x) (values (+/fx hc (if x #x0ace0120 #x0cafe121)) burn)]
[(null? x) (values (+/fx hc #x0cabd122) burn)]
[(number? x) (values (+/fx hc (number-hash x)) burn)]
[(char? x) (values (+/fx hc (char->integer x)) burn)]
[(symbol? x) (values (+/fx hc (symbol-hash x)) burn)]
[(string? x) (values (+/fx hc (string-hash x)) burn)]
[(bytevector? x) (values (+/fx hc (equal-hash x)) burn)]
[(fxvector? x) (values (+/fx hc (equal-hash x)) burn)]
[(flvector? x) (values (+/fx hc (equal-hash x)) burn)]
[(box? x) (equal-hash-loop (unbox x) (fx+ burn 1) (+/fx hc 1))]
[(boolean? x) (values (fx+/wraparound hc (if x #x0ace0120 #x0cafe121)) burn)]
[(null? x) (values (fx+/wraparound hc #x0cabd122) burn)]
[(number? x) (values (fx+/wraparound hc (number-hash x)) burn)]
[(char? x) (values (fx+/wraparound hc (char->integer x)) burn)]
[(symbol? x) (values (fx+/wraparound hc (symbol-hash x)) burn)]
[(string? x) (values (fx+/wraparound hc (string-hash x)) burn)]
[(bytevector? x) (values (fx+/wraparound hc (equal-hash x)) burn)]
[(fxvector? x) (values (fx+/wraparound hc (equal-hash x)) burn)]
[(flvector? x) (values (fx+/wraparound hc (equal-hash x)) burn)]
[(box? x) (equal-hash-loop (unbox x) (fx+ burn 1) (fx+/wraparound hc 1))]
[(pair? x)
(let-values ([(hc0 burn) (equal-hash-loop (car x) (fx+ burn 2) 0)])
(let ([hc (+/fx (mix1 hc) hc0)]
(let ([hc (fx+/wraparound (mix1 hc) hc0)]
[r (cdr x)])
(if (and (pair? r) (list? r))
;; If it continues as a list, don't count cdr direction as burn:
@ -164,7 +152,7 @@
[(vector? x)
(let ([len (vector-length x)])
(cond
[(fx= len 0) (values (+/fx hc 1) burn)]
[(fx= len 0) (values (fx+/wraparound hc 1) burn)]
[else
(let vec-loop ([i 0] [burn burn] [hc hc])
(cond
@ -173,30 +161,31 @@
(let-values ([(hc0 burn) (equal-hash-loop (vector-ref x i) (fx+ burn 2) 0)])
(vec-loop (fx+ i 1)
burn
(+/fx (mix2 hc) hc0)))]))]))]
(fx+/wraparound (mix2 hc) hc0)))]))]))]
[(hash? x)
;; Treat hash-table hashing specially, so it can be order-insensitive
(let ([burn (fx* (fxmax burn 1) 2)])
(let ([hc (+/fx hc (->fx (hash-hash-code
x
(lambda (x)
(let-values ([(hc0 burn0) (equal-hash-loop x burn 0)])
hc0)))))])
(let ([hc (fx+/wraparound hc (->fx (hash-hash-code
x
(lambda (x)
(let-values ([(hc0 burn0) (equal-hash-loop x burn 0)])
hc0)))))])
(values hc burn)))]
[(and (#%$record? x) (#%$record-hash-procedure x))
=> (lambda (rec-hash)
(let ([burn (fx+ burn 2)])
(let ([hc (+/fx hc (->fx (rec-hash x (lambda (x)
(let-values ([(hc0 burn0) (equal-hash-loop x burn 0)])
(set! burn burn0)
hc0)))))])
(let ([hc (fx+/wraparound hc (->fx
(rec-hash x (lambda (x)
(let-values ([(hc0 burn0) (equal-hash-loop x burn 0)])
(set! burn burn0)
hc0)))))])
(values hc burn))))]
[(impersonator? x)
;; If an impersonator wraps a value where `equal?` hashing is
;; `eq?` hashing, such as for a procedure, then make sure
;; we discard the impersonator wrapper.
(equal-hash-loop (impersonator-val x) burn hc)]
[else (values (+/fx hc (eq-hash-code x)) burn)])))
[else (values (fx+/wraparound hc (eq-hash-code x)) burn)])))
(define (hash-code-combine hc v)
(bitwise-and (+ (bitwise-arithmetic-shift-left hc 10)