added schemeerror and used it
svn: r8223
This commit is contained in:
parent
8cbe9a6da9
commit
7f3a5c13c2
|
@ -227,6 +227,7 @@
|
|||
schemeblockelem
|
||||
schemeinput
|
||||
schememod
|
||||
schemeerror
|
||||
scheme SCHEME scheme/form schemeresult schemeid schememodname
|
||||
defmodule defmodule* defmodulelang defmodulelang*
|
||||
defmodule*/no-declare defmodulelang*/no-declare
|
||||
|
@ -305,6 +306,9 @@
|
|||
(define (link url . str)
|
||||
(make-element (make-target-url url) (decode-content str)))
|
||||
|
||||
(define (schemeerror . str)
|
||||
(make-element "schemeerror" (decode-content str)))
|
||||
|
||||
(provide t)
|
||||
(define (t . str)
|
||||
(decode-paragraph str))
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@require[scribble/manual]
|
||||
@require[scribble/eval]
|
||||
@require[scribble/struct]
|
||||
@require["guide-utils.ss"]
|
||||
@require["contracts-utils.ss"]
|
||||
@(require (for-label scheme/contract))
|
||||
|
@ -30,10 +29,9 @@ Several clients used your module. Others used their
|
|||
modules. And all of a sudden one of them sees this error
|
||||
message:
|
||||
|
||||
@(make-element "schemeerror"
|
||||
'("bank-client broke the contract (-> ??? any)
|
||||
@schemeerror{bank-client broke the contract (-> ??? any)
|
||||
it had with myaccount on deposit;
|
||||
expected <???>, given: -10"))
|
||||
expected <???>, given: -10}
|
||||
|
||||
Clearly, @scheme[bank-client] is a module that uses
|
||||
@scheme[myaccount] but what are the @tt{?}s doing there?
|
||||
|
@ -64,10 +62,9 @@ scheme/base
|
|||
With this little change, the error message becomes all of
|
||||
sudden quite readable:
|
||||
|
||||
@(make-element "schemeerror"
|
||||
'("bank-client broke the contract (-> amount any)
|
||||
@schemeerror{bank-client broke the contract (-> amount any)
|
||||
it had with myaccount on deposit;
|
||||
expected <amount>, given: -10"))
|
||||
expected <amount>, given: -10"}
|
||||
|
||||
@question[#:tag "optionals"]{Can a contract specify what the values of optional arguments to a function must be?}
|
||||
|
||||
|
|
|
@ -7,6 +7,14 @@
|
|||
|
||||
@local-table-of-contents[]
|
||||
|
||||
@;{
|
||||
|
||||
Somewhere, discuss eq? and its impact on lists and
|
||||
procedures. Also, discuss difference between contracts on
|
||||
mutable datastructures & contracts on immutable ones.
|
||||
|
||||
}
|
||||
|
||||
@include-section["contracts-intro.scrbl"]
|
||||
@include-section["contracts-simple-function.scrbl"]
|
||||
@include-section["contracts-general-function.scrbl"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user