about summary refs log tree commit diff stats
path: root/counters.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-15 00:00:46 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-15 00:00:46 -0800
commit0d2c3387c59b039ce2dc58ad4545feb04ddc4de4 (patch)
tree8f87ddd5b5590656e95ea99b27e5132672e4d525 /counters.mu
parentec6364a0343315c14dfd1b926991b5ccdd1d7542 (diff)
downloadmu-0d2c3387c59b039ce2dc58ad4545feb04ddc4de4.tar.gz
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.
Diffstat (limited to 'counters.mu')
-rw-r--r--counters.mu10
1 files changed, 5 insertions, 5 deletions
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