fix warnings

original commit: 761a4025ca88cea7166fe25edb9fec8507b4e8c1
This commit is contained in:
Ryan Culpepper 2011-05-11 02:13:00 -06:00
parent 8bd0dd4474
commit 78026f6456

View File

@ -64,7 +64,7 @@
(from-collection ("racket")))) (from-collection ("racket"))))
(and hide-libs? (and hide-libs?
'(or (from-collection ()) '(or (from-collection ())
#;(from-planet-collection #f #f ()))) #|(from-planet-collection #f #f ())|#))
(and hide-contracts? (and hide-contracts?
'(symbol-like #rx"^provide/contract-id-")) '(symbol-like #rx"^provide/contract-id-"))
(and hide-phase1? (and hide-phase1?
@ -74,26 +74,23 @@
;; entries->function : (listof Entry) (id -> choice) -> (id -> choice) ;; entries->function : (listof Entry) (id -> choice) -> (id -> choice)
(define (entries->function entries base-fun) (define (entries->function entries base-fun)
(if (pair? entries) (if (pair? entries)
(let ([first-fun (entry->function (car entries))] (entry->function (car entries)
[rest-fun (entries->function (cdr entries) base-fun)]) (entries->function (cdr entries) base-fun))
(lambda (id)
(or (first-fun id)
(rest-fun id))))
base-fun)) base-fun))
;; entry->function : Entry -> (id -> choice) ;; entry->function : Entry -> (id -> choice)
(define (entry->function entry) (define (entry->function entry base-fun)
(match entry (match entry
[(list 'show-if condition) [(list 'show-if condition)
(let ([pred (condition->predicate condition)]) (let ([pred (condition->predicate condition)])
(lambda (id) (lambda (id)
(if (pred id) 'show #f)))] (if (pred id) 'show (base-fun id))))]
[(list 'hide-if condition) [(list 'hide-if condition)
(let ([pred (condition->predicate condition)]) (let ([pred (condition->predicate condition)])
(lambda (id) (lambda (id)
(if (pred id) 'hide #f)))] (if (pred id) 'hide (base-fun id))))]
[(list 'splice entries) [(list 'splice entries)
(entries->function entries)])) (entries->function entries base-fun)]))
;; condition->predicate : condition -> (id -> boolean) ;; condition->predicate : condition -> (id -> boolean)
(define (condition->predicate condition) (define (condition->predicate condition)