about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-23 19:52:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-23 19:52:11 -0800
commit9923285547c1cd4e1fdb56262ec85284b39b8779 (patch)
treed721842482913b85d62fba3437846328171946de
parentf76f402dd8c3b1aaeaca83a0cc43e90437deb293 (diff)
downloadmu-9923285547c1cd4e1fdb56262ec85284b39b8779.tar.gz
2600 - teach 'print' about addresses
Unfortunate that our type system requires this to be explicit..
-rw-r--r--081print.mu20
1 files changed, 20 insertions, 0 deletions
diff --git a/081print.mu b/081print.mu
index 1683b308..8f61504e 100644
--- a/081print.mu
+++ b/081print.mu
@@ -698,3 +698,23 @@ recipe print screen:address:shared:screen, n:number -> screen:address:shared:scr
   }
   screen <- print-integer screen, n, color, bg-color
 ]
+
+# addresses
+recipe print screen:address:shared:screen, n:address:_elem -> screen:address:shared:screen [
+  local-scope
+  load-ingredients
+  color:number, color-found?:boolean <- next-ingredient
+  {
+    # default color to white
+    break-if color-found?
+    color <- copy 7/white
+  }
+  bg-color:number, bg-color-found?:boolean <- next-ingredient
+  {
+    # default bg-color to black
+    break-if bg-color-found?
+    bg-color <- copy 0/black
+  }
+  n2:number <- copy n
+  screen <- print-integer screen, n2, color, bg-color
+]