Probably a better way to do this, but now the list is of odd length

and I can't just remove define/contract (which is no longer a binding
from scheme/contract) straightforwardly.

svn: r11718
This commit is contained in:
Stevie Strickland 2008-09-13 04:37:51 +00:00
parent 1d9721a406
commit 03347cc390

View File

@ -7,6 +7,8 @@
(*twocolumns (list (scheme id) ...)))
@(define (*twocolumns l)
(let* ([len (length l)]
[l (if (odd? len) (append l (list #f)) l)]
[len (length l)]
[half (quotient len 2)]
[a (for/list ([i (in-range half)]
[e l])
@ -16,10 +18,12 @@
[to-flow (compose make-flow list make-paragraph list)])
(make-table #f
(map (lambda (a b)
(list (to-flow spacer)
(to-flow a)
(to-flow spacer)
(to-flow b)))
(append (list (to-flow spacer)
(to-flow a))
(if b
(list (to-flow spacer)
(to-flow b))
null)))
a b))))
@mzlib[#:mode title contract]
@ -47,7 +51,6 @@ from @schememodname[scheme/contract]:
contract-violation->string
contract?
define-contract-struct
define/contract
false/c
flat-contract
flat-contract-predicate