about summary refs log tree commit diff stats
path: root/apps/tile/environment.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-20 21:48:53 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-20 21:48:53 -0700
commit6b973819d0d0e8f2e7562bff69cc9aaa7c3fe36f (patch)
tree80579b3baf6e3b704c54e50631a448b63eb7d4f2 /apps/tile/environment.mu
parent9ac51594869bd12a4e3363d3384a9ba0302e0084 (diff)
downloadmu-6b973819d0d0e8f2e7562bff69cc9aaa7c3fe36f.tar.gz
7086
Expanding words now seems to be working. I was forgetting to update 'prev'
pointers in a few places.
Diffstat (limited to 'apps/tile/environment.mu')
-rw-r--r--apps/tile/environment.mu13
1 files changed, 2 insertions, 11 deletions
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu
index 23c2d243..22bd94aa 100644
--- a/apps/tile/environment.mu
+++ b/apps/tile/environment.mu
@@ -679,9 +679,7 @@ fn copy-unbound-words-to-args _functions: (addr handle function) {
       var rest-ah/ecx: (addr handle word) <- address rest-h
       copy-object dest-ah, rest-ah
       copy-word curr, dest-ah
-      var dest/eax: (addr word) <- lookup *dest-ah
-      var next-ah/eax: (addr handle word) <- get dest, next
-      copy-object rest-ah, next-ah
+      chain-words dest-ah, rest-ah
     }
     var next-ah/ecx: (addr handle word) <- get curr, next
     curr <- lookup *next-ah
@@ -728,16 +726,9 @@ fn construct-call _f-ah: (addr handle function), _dest-ah: (addr handle word) {
   var dest-ah/edi: (addr handle word) <- copy _dest-ah
   copy-words-in-reverse args-ah, dest-ah
   # append name
-  {
-    var dest/eax: (addr word) <- lookup *dest-ah
-    compare dest, 0
-    break-if-=
-    dest-ah <- get dest, next
-    loop
-  }
   var name-ah/eax: (addr handle array byte) <- get f, name
   var name/eax: (addr array byte) <- lookup *name-ah
-  allocate-word-with dest-ah, name
+  append-word-at-end-with dest-ah, name
 }
 
 fn word-index _words: (addr handle word), _n: int, out: (addr handle word) {