-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathruntime.arc
More file actions
25 lines (20 loc) · 765 Bytes
/
runtime.arc
File metadata and controls
25 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(use arc extend-ontype)
(defrule type (ar-tnil (racket-namespace? x))
'runtime)
(with (orig bound default (list 'default))
(redef bound (name (o runtime))
(if runtime
(isnt (racket-namespace-variable-value
name (ail-code #t) (fn () default) runtime)
default)
(orig name))))
(extend-ontype ar-apply-non-fn runtime (runtime (varname))
(ail-code (racket-namespace-variable-value varname #t #f runtime)))
(extend-ontype sref runtime (runtime value varname)
(ail-code (racket-namespace-set-variable-value!
varname value #t runtime)))
(def runtime ((o uses) (o usepath (usepath*)))
(let runtime (new-runtime usepath)
(each item uses
(runtime!use-apply item))
runtime))