fix contract in docs, fixes #2780

This commit is contained in:
Matthias Felleisen 2019-08-04 10:35:48 -04:00
parent 68621c3ee1
commit 89e1ba55a5

View File

@ -542,16 +542,20 @@ Now, suppose that we also want to ensure that the first result of
first contract strengthens the old one so that the result is a prefix of first contract strengthens the old one so that the result is a prefix of
the given word. the given word.
This contract is expensive to check, of course. Here is a slightly This contract is expensive to check, of course. Here is a
cheaper version: cheaper, though less stringent, version:
@racketblock[ @racketblock[
(provide (provide
(contract-out (contract-out
[split (->i ([fl (listof char?)]) [split (->i ([fl (listof char?)])
(values [s (fl) (string-len/c (length fl))] (values [s (fl) (string-len/c (+ 1 (length fl)))]
[c (listof char?)]))])) [c (listof char?)]))]))
] ]
Stop! Why did we add @racket[1] to the length of @racket[fl]?
@;{
Running @racket[(split '())] would reveal this documentation bug.
}
@ctc-section[#:tag "no-domain"]{Fixed but Statically Unknown Arities} @ctc-section[#:tag "no-domain"]{Fixed but Statically Unknown Arities}