summaryrefslogtreecommitdiff
path: root/src/as.scm
blob: b95c09635042916c7119caee96e0119790d863a8 (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-interface module)))
         (v (thunk))
         (_ (set-current-module curmod)))
    v))

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

(define (as what file)
  (load-with-interface file `(src as ,what)))