From b16376494824e30cf9149a6b161f2e44204a5bda Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 26 Jul 2014 12:25:40 -0700 Subject: 2 - use literal syms instead of type codes --- mu.arc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'mu.arc') diff --git a/mu.arc b/mu.arc index c01bcdde..2ade5175 100644 --- a/mu.arc +++ b/mu.arc @@ -2,18 +2,17 @@ ; code; types; args channel (def clear () (= types* (obj - integer (obj size 1) - type (obj size 1) - location (obj size 1) - address (obj size 1) - boolean (obj size 1))) + type (obj size 1 record nil array nil address nil) + location (obj size 1 record nil array nil address nil) + integer (obj size 1 record nil array nil address nil) + boolean (obj size 1 record nil array nil address nil) + integer-array (obj array t elem 'integer) ; array of ints, size in front + integer-address (obj size 1 address t elem 'integer) ; pointer to int + )) (= memory* (table)) (= function* (table))) (clear) -; just a convenience until we get an assembler -(= type* (obj integer 0 type 1 location 2 address 3 boolean 4)) - (def add-fns (fns) (each (name . body) fns (= function*.name body))) @@ -90,7 +89,7 @@ (memory* fn-args.idx.1))) otype (= (memory* oarg.0.1) - (type* (otypes arg.0))) + (otypes arg.0)) jmp (do (= pc (+ pc arg.0.1)) ; relies on continue still incrementing (bug) ;? (prn "jumping to " pc) -- cgit 1.4.1-2-gfad0