From 0d2c3387c59b039ce2dc58ad4545feb04ddc4de4 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 15 Jan 2015 00:00:46 -0800 Subject: 571 - screen primitives take an explicit terminal This will let me swap in a fake in tests. Still hacky, though. I'm sure I'm not managing the parameter right in the chessboard app. And then there's the question of whether it should also appear as an output operand. But it's a start. And using nil to mean 'real' is a reasonable convention. If I ever need to handle multiple screens perhaps we'll have to switch to 1:literal/terminal and 2:literal/terminal, etc. But those are equally easy to guard on. --- counters.mu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'counters.mu') diff --git a/counters.mu b/counters.mu index 6f26abae..90805639 100644 --- a/counters.mu +++ b/counters.mu @@ -23,11 +23,11 @@ (bres:integer <- increment-counter b:space-address 2:literal) (ares:integer <- increment-counter a:space-address 1:literal) ; check results - (print-primitive (("Contents of counters a: " literal))) - (print-primitive ares:integer) - (print-primitive ((" b: " literal))) - (print-primitive bres:integer) - (print-primitive (("\n" literal))) + (print-primitive nil:literal/terminal (("Contents of counters a: " literal))) + (print-primitive nil:literal/terminal ares:integer) + (print-primitive nil:literal/terminal ((" b: " literal))) + (print-primitive nil:literal/terminal bres:integer) + (print-primitive nil:literal/terminal (("\n" literal))) ]) ; compare http://www.paulgraham.com/accgen.html -- cgit 1.4.1-2-gfad0