add contract to 'table'
This commit is contained in:
parent
ec4542383c
commit
735881831b
|
@ -674,8 +674,8 @@ Like @racket[pin-over], but @racket[pict] is drawn before
|
|||
|
||||
@defproc[(table [ncols exact-positive-integer?]
|
||||
[picts (non-empty-listof pict?)]
|
||||
[col-aligns (list*of (pict? pict? -> pict?))]
|
||||
[row-aligns (list*of (pict? pict? -> pict?))]
|
||||
[col-aligns (list*of (->* () #:rest (listof pict?) pict?))]
|
||||
[row-aligns (list*of (->* () #:rest (listof pict?) pict?))]
|
||||
[col-seps (list*of real?)]
|
||||
[row-seps (list*of real?)])
|
||||
pict?]{
|
||||
|
|
|
@ -23,8 +23,18 @@
|
|||
htl-append
|
||||
hbl-append
|
||||
cellophane
|
||||
dc)
|
||||
dc
|
||||
table)
|
||||
(contract-out
|
||||
[table (->i ([ncols exact-positive-integer?]
|
||||
[picts (non-empty-listof pict?)]
|
||||
[col-aligns (list*of (->* () #:rest (listof pict?) pict?))]
|
||||
[row-aligns (list*of (->* () #:rest (listof pict?) pict?))]
|
||||
[col-seps (list*of real?)]
|
||||
[row-seps (list*of real?)])
|
||||
#:pre (ncols picts)
|
||||
(zero? (remainder (length picts) ncols))
|
||||
[result pict?])]
|
||||
[dc (->i ([draw (-> (is-a?/c dc<%>) real? real? any)]
|
||||
[w real?]
|
||||
[h real?])
|
||||
|
|
|
@ -875,8 +875,6 @@
|
|||
(define table
|
||||
(case-lambda
|
||||
[(ncol cells col-aligns row-aligns col-seps row-seps)
|
||||
(unless (positive? ncol)
|
||||
(raise-type-error 'table "positive column count" ncol))
|
||||
(let ([count (length cells)])
|
||||
(unless (zero? (remainder count ncol))
|
||||
(error 'table "cell count isn't divisble by the provided column count"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user