From e008fc33999bd022c63c8493a1894428ed49053e Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 20 Jun 2011 14:53:42 +0800 Subject: [PATCH] improved the error messsage for contract violations of preferences:add-callback --- collects/framework/preferences.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collects/framework/preferences.rkt b/collects/framework/preferences.rkt index 1806a2f237..db85ac27e1 100644 --- a/collects/framework/preferences.rkt +++ b/collects/framework/preferences.rkt @@ -371,7 +371,8 @@ the state transitions / contracts are: ;; important that this arg only has a flat contract ;; so that no wrapper is created, so that ;; the weak box stuff works ... - (λ (x) (and (procedure? x) (procedure-arity-includes? x 2)))) + (let ([procedure-with-arity2? (λ (x) (and (procedure? x) (procedure-arity-includes? x 2)))]) + procedure-with-arity2?)) (boolean?) (-> void?)) ((p f)