about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-08-21 21:37:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-08-21 21:37:55 -0700
commit734e8c28241e95f7425a18d8791b35ff5e98f7db (patch)
tree145af12466512661ec06bb8099f5720ee68be241
parent6da81a3e4a64d404141c0bf0b77126860fbe0f50 (diff)
downloadmu-734e8c28241e95f7425a18d8791b35ff5e98f7db.tar.gz
69
-rw-r--r--mu.arc16
1 files changed, 8 insertions, 8 deletions
diff --git a/mu.arc b/mu.arc
index 4029ab20..8658c7fb 100644
--- a/mu.arc
+++ b/mu.arc
@@ -5,6 +5,14 @@
   (each f (as cons initialization-fns*)
     (f)))
 
+(mac init-fn (name . body)
+  `(enq (fn () (= (function* ',name) ',body))
+        initialization-fns*))
+
+(mac on-init body
+  `(enq (fn () (run ',body))
+        initialization-fns*))
+
 (def clear ()
   (= types* (obj
               ; must be scalar or array, sum or product or primitive
@@ -26,14 +34,6 @@
   (= function* (table)))
 (enq clear initialization-fns*)
 
-(mac init-fn (name . body)
-  `(enq (fn () (= (function* ',name) ',body))
-        initialization-fns*))
-
-(mac on-init body
-  `(enq (fn () (run ',body))
-        initialization-fns*))
-
 (def add-fns (fns)
   (each (name . body) fns
     (= function*.name body)))
'Blame the previous revision' href='/akkartik/mu/blame/subx/061error.subx?h=hlt&id=7cb326df5bb9739d948dd4f8b32019f1bf6e4ef3'>^
0eb0f696 ^



7cb326df ^

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50