fix meta/check-dists

(Also, use a hash table instead of an association list for a
query cache.)
This commit is contained in:
Matthew Flatt 2011-12-04 07:48:48 -07:00
parent 59e41ce05f
commit 1c6354e235
2 changed files with 12 additions and 5 deletions

View File

@ -25,8 +25,11 @@
(set-racket-tree! racket/ racket-base/ racket/-name null)
(set-bin-files-delayed-lists!
;; FIXME: hard-wired list of binary-specific files
'())
;; FIXME: hard-wired list of binary-specific files;
;; we assume there are none. This value is a list of
;; lists, where a given file must appear in every list
;; to be ok for the distribution.
'(()))
(expand-spec 'distributions)

View File

@ -398,11 +398,15 @@
;; contents is still marked.
(define (primitive-spec->filter spec)
(define (add-query-cache! t r)
(prop-set! (tree-path t) 'queries
(cons (cons spec r) (prop-get (tree-path t) 'queries '()))))
(hash-set! (prop-get (tree-path t) 'queries
(lambda () (let ([ht (make-hash)])
(prop-set! (tree-path t) 'queries ht)
ht)))
spec
r))
(define (make-cached filter)
(lambda (t)
(cond [(assoc spec (prop-get (tree-path t) 'queries '())) => cdr]
(cond [(hash-ref (prop-get (tree-path t) 'queries #hash()) spec #f)]
[else (let ([r (filter t)])
(case r
[(+ -) (let loop ([t t])