use impersonator-ephemeron to allow a
real contract on preferences:add-callback
This commit is contained in:
parent
796550bd9f
commit
164a5831b8
|
@ -191,7 +191,7 @@ the state transitions / contracts are:
|
||||||
(define preferences:add-callback
|
(define preferences:add-callback
|
||||||
(lambda (p callback [weak? #f])
|
(lambda (p callback [weak? #f])
|
||||||
(let ([new-cb (make-pref-callback (if weak?
|
(let ([new-cb (make-pref-callback (if weak?
|
||||||
(make-weak-box callback)
|
(make-weak-box (impersonator-ephemeron callback))
|
||||||
callback))])
|
callback))])
|
||||||
(hash-set! callbacks
|
(hash-set! callbacks
|
||||||
p
|
p
|
||||||
|
@ -365,13 +365,7 @@ the state transitions / contracts are:
|
||||||
|
|
||||||
(proc-doc/names
|
(proc-doc/names
|
||||||
preferences:add-callback
|
preferences:add-callback
|
||||||
(->* (symbol?
|
(->* (symbol? (-> symbol? any/c any))
|
||||||
|
|
||||||
;; important that this arg only has a flat contract
|
|
||||||
;; so that no wrapper is created, so that
|
|
||||||
;; the weak box stuff works ...
|
|
||||||
(let ([procedure-with-arity2? (λ (x) (and (procedure? x) (procedure-arity-includes? x 2)))])
|
|
||||||
procedure-with-arity2?))
|
|
||||||
(boolean?)
|
(boolean?)
|
||||||
(-> void?))
|
(-> void?))
|
||||||
((p f)
|
((p f)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user