Adding more specific contracts

svn: r15709
This commit is contained in:
Jay McCarthy 2009-08-11 22:31:44 +00:00
parent d8bc61ae41
commit 3432cf282f
6 changed files with 22 additions and 19 deletions

View File

@ -10,8 +10,11 @@
(provide/contract (provide/contract
[cite ((string?) () #:rest (listof string?) . ->* . element?)] [cite ((string?) () #:rest (listof string?) . ->* . element?)]
[bib-entry ((#:key string? #:title any/c) ; XXX should be pre-content or #f [bib-entry ((#:key string? #:title (or/c false/c pre-content?))
(#:is-book? any/c #:author any/c #:location any/c #:date any/c #:url any/c) (#:is-book? boolean? #:author (or/c false/c pre-content?)
#:location (or/c false/c pre-content?)
#:date (or/c false/c pre-content?)
#:url (or/c false/c pre-content?))
. ->* . . ->* .
a-bib-entry?)] a-bib-entry?)]
[rename a-bib-entry? bib-entry? (any/c . -> . boolean?)] [rename a-bib-entry? bib-entry? (any/c . -> . boolean?)]

View File

@ -33,8 +33,7 @@
make-binding-redirect-elements make-binding-redirect-elements
sigelem) sigelem)
(provide/contract (provide/contract
; XXX any/c should be boolean? [defidentifier ((identifier?) (#:form? boolean? #:index? boolean? #:show-libs? boolean?) . ->* . element?)])
[defidentifier ((identifier?) (#:form? any/c #:index? any/c #:show-libs? any/c) . ->* . element?)])
(define (gen-absolute-tag) (define (gen-absolute-tag)
`(abs ,(make-generated-tag))) `(abs ,(make-generated-tag)))

View File

@ -34,7 +34,7 @@
[undefined-const element?] [undefined-const element?]
[hash-lang (-> element?)] [hash-lang (-> element?)]
[etc string?] [etc string?]
[inset-flow (() () #:rest (listof any/c) . ->* . any/c)] ; XXX no docs and bad return contract [inset-flow (() () #:rest (listof pre-content?) . ->* . any/c)] ; XXX no docs and bad return contract
[litchar (() () #:rest (listof string?) . ->* . element?)] [litchar (() () #:rest (listof string?) . ->* . element?)]
[t (() () #:rest (listof pre-content?) . ->* . paragraph?)] [t (() () #:rest (listof pre-content?) . ->* . paragraph?)]
[commandline (() () #:rest (listof pre-content?) . ->* . paragraph?)] [commandline (() () #:rest (listof pre-content?) . ->* . paragraph?)]

View File

@ -7,8 +7,7 @@
"manual-style.ss") "manual-style.ss")
(provide/contract (provide/contract
; XXX boolean? [deftech (() (#:style? boolean?) #:rest (listof pre-content?) . ->* . element?)]
[deftech (() (#:style? any/c) #:rest (listof pre-content?) . ->* . element?)]
[tech (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)] [tech (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)]
[techlink (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)]) [techlink (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)])

View File

@ -2,16 +2,18 @@
(require "../struct.ss" (require "../struct.ss"
"../decode.ss" "../decode.ss"
"../base.ss" "../base.ss"
(only-in "../core.ss"
content?)
scheme/contract scheme/contract
scheme/list) scheme/list)
(provide doc-prefix) (provide doc-prefix)
(provide/contract (provide/contract
[spacer element?] [spacer element?]
[to-flow (any/c . -> . flow?)] ; XXX element? [to-flow (content? . -> . flow?)]
[flow-spacer flow?] [flow-spacer flow?]
[flow-empty-line flow?] [flow-empty-line flow?]
[make-table-if-necessary (any/c list? . -> . (list/c (or/c omitable-paragraph? table?)))] ; XXX element? [make-table-if-necessary (content? list? . -> . (list/c (or/c omitable-paragraph? table?)))]
[max-proto-width exact-nonnegative-integer?]) [max-proto-width exact-nonnegative-integer?])
(define spacer (hspace 1)) (define spacer (hspace 1))

View File

@ -651,9 +651,9 @@ Like @scheme[schemegrammar], but for typesetting multiple productions
at once, aligned around the @litchar{=} and @litchar{|}.} at once, aligned around the @litchar{=} and @litchar{|}.}
@defproc[(defidentifier [id identifier?] @defproc[(defidentifier [id identifier?]
[#:form? form? any/c #f] [#:form? form? boolean? #f]
[#:index? index? any/c #t] [#:index? index? boolean? #t]
[#:show-libs? show-libs? any/c #t]) [#:show-libs? show-libs? boolean? #t])
element?]{ element?]{
Typesets @scheme[id] as a Scheme identifier, and also establishes the Typesets @scheme[id] as a Scheme identifier, and also establishes the
@ -906,7 +906,7 @@ An alias of @scheme[hyperlink] for backward compatibility.}
An alias of @scheme[other-doc] for backward compatibility.} An alias of @scheme[other-doc] for backward compatibility.}
@defproc[(deftech [pre-content pre-content?] ... @defproc[(deftech [pre-content pre-content?] ...
[#:style? style? any/c #t]) element?]{ [#:style? style? boolean? #t]) element?]{
Produces an element for the @tech{decode}d @scheme[pre-content], and Produces an element for the @tech{decode}d @scheme[pre-content], and
also defines a term that can be referenced elsewhere using also defines a term that can be referenced elsewhere using
@ -1031,12 +1031,12 @@ which is created with @scheme[bib-entry]. The entries are typeset in
order as given.} order as given.}
@defproc[(bib-entry [#:key key string?] @defproc[(bib-entry [#:key key string?]
[#:title title any/c] [#:title title (or/c false/c pre-content?)]
[#:is-book? is-book? any/c #f] [#:is-book? is-book? boolean? #f]
[#:author author any/c #f] [#:author author (or/c false/c pre-content?) #f]
[#:location location any/c #f] [#:location location (or/c false/c pre-content?) #f]
[#:date date any/c #f] [#:date date (or/c false/c pre-content?) #f]
[#:url url any/c #f]) [#:url url (or/c false/c pre-content?) #f])
bib-entry?]{ bib-entry?]{
Creates a bibliography entry. The @scheme[key] is used to refer to the Creates a bibliography entry. The @scheme[key] is used to refer to the