about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-08-19 12:02:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-08-19 12:02:40 -0700
commit889e4b958e0755eb18f4d545ba4f191d9ea0296c (patch)
treecf741bd6858a4f4c9eeb5fdbd1c9f4edd578f22c /mu.arc
parent955ecf4a45312c495403aacc0b687a4bc33844ec (diff)
downloadmu-889e4b958e0755eb18f4d545ba4f191d9ea0296c.tar.gz
53 - simplest possible allocator: just one word at a time
But with tests this time.
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc8
1 files changed, 8 insertions, 0 deletions
diff --git a/mu.arc b/mu.arc
index 3499bb49..df63e916 100644
--- a/mu.arc
+++ b/mu.arc
@@ -18,6 +18,14 @@
   (= 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)))