Fix interaction between new DMdA contract representation and stepper.
- add proper hash procedures - fix prining
This commit is contained in:
parent
5f8924b1d2
commit
a0d82d07a6
|
@ -48,10 +48,24 @@
|
||||||
|
|
||||||
(define-struct contract (name enforcer syntax-promise (arbitrary-promise #:mutable) info-promise <=?-proc =?-proc)
|
(define-struct contract (name enforcer syntax-promise (arbitrary-promise #:mutable) info-promise <=?-proc =?-proc)
|
||||||
#:constructor-name really-make-contract
|
#:constructor-name really-make-contract
|
||||||
#:transparent ; #### for debugging, remove
|
|
||||||
#:property prop:equal+hash
|
#:property prop:equal+hash
|
||||||
(list (lambda (c1 c2 equal?) (contract=? c1 c2)) ; #### use equal?
|
(list (lambda (c1 c2 equal?) (contract=? c1 c2)) ; #### use equal?
|
||||||
void void)) ; hash procs
|
(lambda (r recur)
|
||||||
|
(+ (recur (contract-name r))
|
||||||
|
(* 33 (recur (contract-enforcer r)))))
|
||||||
|
(lambda (r recur)
|
||||||
|
(+ (* 33 (recur (contract-name r)))
|
||||||
|
(recur (contract-enforcer r)))))
|
||||||
|
#:property prop:custom-write
|
||||||
|
(lambda (r port write?)
|
||||||
|
(cond
|
||||||
|
((contract-name r)
|
||||||
|
=> (lambda (name)
|
||||||
|
(display "#<contract " port)
|
||||||
|
(display name port)
|
||||||
|
(display "#>" port)))
|
||||||
|
(else
|
||||||
|
(display "#<contract>" port)))))
|
||||||
|
|
||||||
(define (make-contract name enforcer syntax-promise
|
(define (make-contract name enforcer syntax-promise
|
||||||
#:arbitrary-promise (arbitrary-promise #f)
|
#:arbitrary-promise (arbitrary-promise #f)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user