about summary refs log tree commit diff stats
path: root/060string.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-03 11:57:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-03 11:57:23 -0700
commit7e867a045e29a37d66eedce03c95a2feb979411a (patch)
treef8517ea29a86227602878103c71c6242c97a54a0 /060string.mu
parentc77cc6ccd4f49af17cd99f43510cd2a174b26f9f (diff)
downloadmu-7e867a045e29a37d66eedce03c95a2feb979411a.tar.gz
1697 - edit: starting to run code
Diffstat (limited to '060string.mu')
-rw-r--r--060string.mu9
1 files changed, 8 insertions, 1 deletions
diff --git a/060string.mu b/060string.mu
index 4a4f6592..3dbfa374 100644
--- a/060string.mu
+++ b/060string.mu
@@ -111,7 +111,8 @@ recipe new-buffer [
   len:address:number <- get-address result:address:buffer/deref, length:offset
   len:address:number/deref <- copy 0:literal
   s:address:address:array:character <- get-address result:address:buffer/deref, data:offset
-  capacity:number <- next-ingredient
+  capacity:number, found?:boolean <- next-ingredient
+  assert found?:boolean, [new-buffer must get a capacity argument]
   s:address:address:array:character/deref <- new character:type, capacity:number
 #?   $print s:address:address:array:character/deref, [
 #? ]
@@ -173,7 +174,13 @@ recipe buffer-append [
     in:address:buffer <- grow-buffer in:address:buffer
   }
   s:address:array:character <- get in:address:buffer/deref, data:offset
+#?   $print [array underlying buf: ], s:address:array:character, [ 
+#? ] #? 1
+#?   $print [index: ], len:address:number/deref, [ 
+#? ] #? 1
   dest:address:character <- index-address s:address:array:character/deref, len:address:number/deref
+#?   $print [storing ], c:character, [ in ], dest:address:character, [ 
+#? ] #? 1
   dest:address:character/deref <- copy c:character
   len:address:number/deref <- add len:address:number/deref, 1:literal
   reply in:address:buffer/same-as-ingredient:0