From 0d1b217bce3fb9793e334dfb83e2663c33f6bb72 Mon Sep 17 00:00:00 2001 From: Stevie Strickland Date: Sat, 13 Sep 2008 04:45:44 +0000 Subject: [PATCH] Add docs for version of define/contract that is in mzlib/contract. svn: r11719 --- collects/mzlib/scribblings/contract.scrbl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/collects/mzlib/scribblings/contract.scrbl b/collects/mzlib/scribblings/contract.scrbl index d1fec7255d..5e586bd996 100644 --- a/collects/mzlib/scribblings/contract.scrbl +++ b/collects/mzlib/scribblings/contract.scrbl @@ -85,3 +85,23 @@ from @schememodname[scheme/contract]: vector-immutableof vector/c vectorof] + +It also provides the old version of @scheme[define/contract]: + +@defform[(define/contract id contract-expr init-value-expr)]{ + +Attaches the contract @scheme[contract-expr] to +@scheme[init-value-expr] and binds that to @scheme[id]. + +The @scheme[define/contract] form treats individual definitions as +units of blame. The definition itself is responsible for positive +(co-variant) positions of the contract and each reference to +@scheme[id] (including those in the initial value expression) must +meet the negative positions of the contract. + +Error messages with @scheme[define/contract] are not as clear as those +provided by @scheme[provide/contract], because +@scheme[define/contract] cannot detect the name of the definition +where the reference to the defined variable occurs. Instead, it uses +the source location of the reference to the variable as the name of +that definition.}