Add equality operations for Reps.
This speeds up microbenchmarks by 50%, and new-metrics.rkt by 30%.
This commit is contained in:
parent
d3e008af50
commit
5cf65e28fc
|
@ -30,7 +30,12 @@
|
||||||
;; free-vars: cached free type variables
|
;; free-vars: cached free type variables
|
||||||
;; free-idxs: cached free dot sequence variables
|
;; free-idxs: cached free dot sequence variables
|
||||||
;; stx: originating syntax for error-reporting
|
;; stx: originating syntax for error-reporting
|
||||||
(define-struct Rep (seq free-vars free-idxs stx) #:transparent)
|
(define-struct Rep (seq free-vars free-idxs stx) #:transparent
|
||||||
|
#:methods gen:equal+hash
|
||||||
|
[(define (equal-proc x y recur)
|
||||||
|
(eq? (unsafe-Rep-seq x) (unsafe-Rep-seq y)))
|
||||||
|
(define (hash-proc x recur) (unsafe-Rep-seq x))
|
||||||
|
(define (hash2-proc x recur) (unsafe-Rep-seq x))])
|
||||||
|
|
||||||
;; evil tricks for hygienic yet unhygienic-looking reference
|
;; evil tricks for hygienic yet unhygienic-looking reference
|
||||||
;; in say def-type for type-ref-id
|
;; in say def-type for type-ref-id
|
||||||
|
|
Loading…
Reference in New Issue
Block a user