|
|
@ -1,6 +1,5 @@
|
|
|
|
#lang racket/base
|
|
|
|
#lang racket/base
|
|
|
|
(require racket/rerequire)
|
|
|
|
(require racket/rerequire)
|
|
|
|
(require "debug.rkt" sugar/coercion/values)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; The cache is a hash with paths as keys.
|
|
|
|
;; The cache is a hash with paths as keys.
|
|
|
|
;; The cache values are also hashes, with key/value pairs for that path.
|
|
|
|
;; The cache values are also hashes, with key/value pairs for that path.
|
|
|
@ -13,6 +12,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
(define (make-cache) (make-hash))
|
|
|
|
(define (make-cache) (make-hash))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (->complete-path path-string)
|
|
|
|
|
|
|
|
(path->complete-path (if (string? path-string) (string->path path-string) path-string)))
|
|
|
|
|
|
|
|
|
|
|
|
(define (cache-ref path-string)
|
|
|
|
(define (cache-ref path-string)
|
|
|
|
(hash-ref (current-cache) (->complete-path path-string)))
|
|
|
|
(hash-ref (current-cache) (->complete-path path-string)))
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +30,6 @@
|
|
|
|
(hash-set! cache-hash 'metas (dynamic-require path 'metas))
|
|
|
|
(hash-set! cache-hash 'metas (dynamic-require path 'metas))
|
|
|
|
(void))
|
|
|
|
(void))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (cached-require path-string key)
|
|
|
|
(define (cached-require path-string key)
|
|
|
|
(when (not (current-cache)) (error "cached-require: No cache set up."))
|
|
|
|
(when (not (current-cache)) (error "cached-require: No cache set up."))
|
|
|
|
|
|
|
|
|
|
|
|