From e0bf118825765fc2a81e7a5c9b65304c3cc02b02 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 19 Nov 2014 00:19:57 -0800 Subject: 275 - pass args to fork Only literals for starters. --- mu.arc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mu.arc') 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 -- cgit 1.4.1-2-gfad0