about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-19 00:19:57 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-19 00:23:48 -0800
commite0bf118825765fc2a81e7a5c9b65304c3cc02b02 (patch)
tree5a73c09ed4b2f38b5f8e283faa07257a4518a820 /mu.arc
parent38e51bc6175397d134b10b0ba87e4bd77067d32d (diff)
downloadmu-e0bf118825765fc2a81e7a5c9b65304c3cc02b02.tar.gz
275 - pass args to fork
Only literals for starters.
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc7
1 files changed, 4 insertions, 3 deletions
diff --git a/mu.arc b/mu.arc
index 9bf1e703..522ddff4 100644
--- a/mu.arc
+++ b/mu.arc
@@ -131,9 +131,9 @@
 ;; managing concurrent routines
 
 ; routine = runtime state for a serial thread of execution
-(def make-routine (fn-name)
+(def make-routine (fn-name . args)
   (annotate 'routine (obj call-stack (list
-      (obj fn-name fn-name  pc 0  caller-arg-idx 0)))))
+      (obj fn-name fn-name  pc 0  args args  caller-arg-idx 0)))))
 
 (defextend empty (x)  (isa x 'routine)
   (no rep.x!call-stack))
@@ -501,7 +501,8 @@
                 run
                   (run (v arg.0))
                 fork
-                  (enq (make-routine (v arg.0)) running-routines*)
+                  (let v car  ; same effect as 'v' macro
+                    (enq (apply make-routine (v car.arg) (map v cdr.arg)) running-routines*))
                 ; todo: errors should stall a process and let its parent
                 ; inspect it
                 assert