about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-10-04 23:00:19 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-04 23:00:19 -0700
commitbdadc933ef7aa44535533a106139aa1b1506e9aa (patch)
treef69fda37d7958f8892f95737c6cdd9e290476cb3 /mu.arc
parent133401ecbc34b0b06a72717c5dd2875293171985 (diff)
downloadmu-bdadc933ef7aa44535533a106139aa1b1506e9aa.tar.gz
95
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc37
1 files changed, 19 insertions, 18 deletions
diff --git a/mu.arc b/mu.arc
index ceca177e..9b26027c 100644
--- a/mu.arc
+++ b/mu.arc
@@ -58,6 +58,7 @@
               location (obj size 1)
               integer (obj size 1)
               boolean (obj size 1)
+              string (obj size 1)  ; temporary hack
               ; arrays consist of an integer length followed by the right number of elems
               integer-array (obj array t  elem 'integer)
               integer-address (obj size 1  address t  elem 'integer)  ; pointer to int
@@ -292,9 +293,6 @@
                     (if types*.type!array
                       (new-array type (v arg.1))
                       (new-scalar type)))
-                print
-                  (do1 nil
-                    (apply prn (map m arg)))
 
                 ; multiprocessing
                 run
@@ -302,6 +300,22 @@
                 fork
                   (enq (make-context (v arg.0)) contexts*)
 
+                ; text interaction
+                cls
+                  (do1 nil ($.charterm-clear-screen))
+                cll
+                  (do1 nil ($.charterm-clear-line))
+                cursor
+                  (do1 nil ($.charterm-cursor (m arg.0) (m arg.1)))
+                print
+                  (do1 nil ($.charterm-display (m arg.0)))
+                getc
+                  ($.charterm-read-key)
+                bold-mode
+                  (do1 nil ($.charterm-bold))
+                non-bold-mode
+                  (do1 nil ($.charterm-normal))
+
                 reply
                   (do (pop-stack context)
                       (if empty.context (return ninstrs))
@@ -435,20 +449,7 @@
 (reset)
 (awhen cdr.argv
   (map add-fns:readfile it)
+  ($.open-charterm)
   (run 'main)
+  ($.close-charterm)
   (prn memory*))
-
-($:with-charterm
-  (charterm-clear-screen)
-  (charterm-cursor 10 5)
-  (charterm-display "Hello, ")
-  (charterm-bold)
-  (charterm-display "you")
-  (charterm-normal)
-  (charterm-display ".")
-  (charterm-cursor 1 1)
-  (charterm-display "Press a key...")
-  (let ((key (charterm-read-key)))
-    (charterm-cursor 1 1)
-    (charterm-clear-line)
-    (printf "You pressed: ~S\r\n" key)))
gt; 2015-06-21 23:37:49 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-06-21 23:42:39 -0700 1617' href='/akkartik/mu/commit/display.mu?h=main&id=6a0f71b9f89df0940a342cd2c91d246cecc18bdf'>6a0f71b9 ^
0012c703 ^
6a0f71b9 ^
290fe117 ^

54d48b25 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25