|
|
@ -7,6 +7,16 @@
|
|
|
|
(list? procedure? . -> . list?)
|
|
|
|
(list? procedure? . -> . list?)
|
|
|
|
(dropf-right (dropf items test-proc) test-proc))
|
|
|
|
(dropf-right (dropf items test-proc) test-proc))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; convert a list into a list of slices that are len long (last one might be shorter)
|
|
|
|
|
|
|
|
(define+provide/contract (list->slices xs len)
|
|
|
|
|
|
|
|
(list? integer? . -> . (listof list?))
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
|
|
|
[(equal? xs null) null]
|
|
|
|
|
|
|
|
[(len . > . (length xs)) (list xs)]
|
|
|
|
|
|
|
|
[else (cons (take xs len) (list->slices (drop xs len) len))]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; split list into list of sublists using test-proc
|
|
|
|
;; split list into list of sublists using test-proc
|
|
|
|
(define+provide/contract (splitf-at* xs split-test)
|
|
|
|
(define+provide/contract (splitf-at* xs split-test)
|
|
|
|