add "cache-ns.rkt" as helper (closes #82)

pull/84/head
Matthew Butterick 9 years ago
parent a6e2f82d21
commit a854844ae6

@ -0,0 +1,8 @@
#lang racket/base
(provide (all-defined-out))
(define (load-in-namespace to-ns . module-names)
(for-each (λ(mn) (eval `(require ,mn) to-ns)) module-names))
(define (copy-from-namespace from-ns to-ns . module-names)
(for-each (λ(mn) (namespace-attach-module from-ns mn to-ns)) module-names))

@ -1,5 +1,5 @@
#lang racket/base #lang racket/base
(require racket/path racket/file file/cache sugar/coerce "project.rkt" "world.rkt" "rerequire.rkt") (require racket/path racket/file file/cache sugar/coerce "project.rkt" "world.rkt" "rerequire.rkt" "cache-ns.rkt")
;; 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.
@ -47,12 +47,6 @@
(require 'caching-module) (require 'caching-module)
(define caching-module-ns (namespace-anchor->namespace caching-module-nsa)) (define caching-module-ns (namespace-anchor->namespace caching-module-nsa))
(define (load-in-namespace to-ns . module-names)
(for-each (λ(mn) (eval `(require ,mn) to-ns)) module-names))
(define (copy-from-namespace from-ns to-ns . module-names)
(for-each (λ(mn) (namespace-attach-module from-ns mn to-ns)) module-names))
(define cached-module-names '(xml (define cached-module-names '(xml
racket/bool racket/bool
racket/class racket/class

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/file racket/path racket/match) (require racket/file racket/path racket/match)
(require sugar/test sugar/define sugar/container sugar/file) (require sugar/test sugar/define sugar/container sugar/file)
(require "file.rkt" "cache.rkt" "world.rkt" "debug.rkt" "pagetree.rkt" "project.rkt" "template.rkt" "rerequire.rkt") (require "file.rkt" "cache.rkt" "world.rkt" "debug.rkt" "pagetree.rkt" "project.rkt" "template.rkt" "rerequire.rkt" "cache-ns.rkt")
;; used to track renders according to modification dates of component files ;; used to track renders according to modification dates of component files
(define mod-date-hash (make-hash)) (define mod-date-hash (make-hash))
@ -230,12 +230,6 @@
(require 'caching-module) (require 'caching-module)
(define caching-module-ns (namespace-anchor->namespace caching-module-nsa)) (define caching-module-ns (namespace-anchor->namespace caching-module-nsa))
(define (load-in-namespace to-ns . module-names)
(for-each (λ(mn) (eval `(require ,mn) to-ns)) module-names))
(define (copy-from-namespace from-ns to-ns . module-names)
(for-each (λ(mn) (namespace-attach-module from-ns mn to-ns)) module-names))
(define cached-module-names '(xml (define cached-module-names '(xml
racket/bool racket/bool
racket/class racket/class

Loading…
Cancel
Save