From 7e867a045e29a37d66eedce03c95a2feb979411a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 3 Jul 2015 11:57:23 -0700 Subject: 1697 - edit: starting to run code --- 060string.mu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '060string.mu') 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 -- cgit 1.4.1-2-gfad0