about summary refs log tree commit diff stats
path: root/apps/tile/word.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-20 01:03:39 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-20 01:07:21 -0700
commitc2d537c46b234f03d683f967aafbca20914a72e1 (patch)
tree4c31db55a98a4187605f13284dcfd6550ec4dfe3 /apps/tile/word.mu
parent0cdbfff25664d2bd3257220ca1509e7bfbd84c75 (diff)
downloadmu-c2d537c46b234f03d683f967aafbca20914a72e1.tar.gz
7080
Constructing new functions with ctrl-d is now working right. But the call
seems exactly flipped.
Diffstat (limited to 'apps/tile/word.mu')
-rw-r--r--apps/tile/word.mu8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/tile/word.mu b/apps/tile/word.mu
index e9101eb2..e6167820 100644
--- a/apps/tile/word.mu
+++ b/apps/tile/word.mu
@@ -284,6 +284,7 @@ fn copy-word _src-a: (addr word), _dest-ah: (addr handle word) {
   allocate dest-ah
   var _dest-a/eax: (addr word) <- lookup *dest-ah
   var dest-a/eax: (addr word) <- copy _dest-a
+  initialize-word dest-a
   var dest/edi: (addr handle gap-buffer) <- get dest-a, scalar-data
   var src-a/eax: (addr word) <- copy _src-a
   var src/eax: (addr handle gap-buffer) <- get src-a, scalar-data
@@ -346,3 +347,10 @@ fn word-to-string _self: (addr word), out: (addr handle array byte) {
   var data/eax: (addr gap-buffer) <- lookup *data-ah
   gap-buffer-to-string data, out
 }
+
+fn word-is-decimal-integer? _self: (addr word) -> result/eax: boolean {
+  var self/eax: (addr word) <- copy _self
+  var data-ah/eax: (addr handle gap-buffer) <- get self, scalar-data
+  var data/eax: (addr gap-buffer) <- lookup *data-ah
+  result <- gap-buffer-is-decimal-integer? data
+}