summaryrefslogtreecommitdiff
path: root/src/as.scm
blob: d309b8a554eb236f8ee8b3bd3ac303ef67f10557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(define-module (src as)
  #:export (as)
  #:declarative? #f)

(define (call-in-module thunk module)
  (let* ((curmod (current-module))
         (_ (set-current-module (resolve-module module)))
         (v (thunk))
         (_ (set-current-module curmod)))
    v))

(define (load-in-module path module-name)
  (call-in-module (lambda () (load path)) module-name))

(define (as what file)
  (load-in-module file `(src as ,what)))