about summary refs log tree commit diff stats
path: root/edit/001-editor.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-12-28 08:44:36 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-12-28 08:44:36 -0800
commitbbe0801ab1e0b0859c3529ed33fde40b139addd6 (patch)
treefa534bbbb3b345d154432746cd585f9262bd80cd /edit/001-editor.mu
parente94453100dda87a42dee36b2671f850ab6824f54 (diff)
downloadmu-bbe0801ab1e0b0859c3529ed33fde40b139addd6.tar.gz
2548 - teach 'print' to print integers
Still can't print non-integer numbers, so this is a bit hacky.

The big consequence is that you can't print literal characters anymore
because of our rules about how we pick which variant to statically
dispatch to. You have to save to a character variable first.

Maybe I can add an annotation to literals..
Diffstat (limited to 'edit/001-editor.mu')
-rw-r--r--edit/001-editor.mu6
1 files changed, 4 insertions, 2 deletions
diff --git a/edit/001-editor.mu b/edit/001-editor.mu
index 4ef9be36..fd44d493 100644
--- a/edit/001-editor.mu
+++ b/edit/001-editor.mu
@@ -193,7 +193,8 @@ recipe render screen:address:screen, editor:address:editor-data -> last-row:numb
       at-right?:boolean <- equal column, right
       break-unless at-right?
       # print wrap icon
-      print screen, 8617/loop-back-to-left, 245/grey
+      wrap-icon:character <- copy 8617/loop-back-to-left
+      print screen, wrap-icon, 245/grey
       column <- copy left
       row <- add row, 1
       screen <- move-cursor screen, row, column
@@ -227,10 +228,11 @@ recipe render screen:address:screen, editor:address:editor-data -> last-row:numb
 recipe clear-line-delimited screen:address:screen, column:number, right:number -> screen:address:screen [
   local-scope
   load-ingredients
+  space:character <- copy 32/space
   {
     done?:boolean <- greater-than column, right
     break-if done?
-    screen <- print screen, 32/space
+    screen <- print screen, space
     column <- add column, 1
     loop
   }