From c603cd6cef43100aa83a62e15f96fd54c9fb987e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 13 Nov 2015 10:08:57 -0800 Subject: 2430 - make room for more transforms --- 062array.mu | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 062array.mu (limited to '062array.mu') diff --git a/062array.mu b/062array.mu deleted file mode 100644 index 03348c3a..00000000 --- a/062array.mu +++ /dev/null @@ -1,40 +0,0 @@ -scenario array-from-args [ - run [ - 1:address:array:character <- new-array 0, 1, 2 - 2:array:character <- copy *1:address:array:character - ] - memory-should-contain [ - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ] -] - -# create an array out of a list of scalar args -recipe new-array [ - local-scope - capacity:number <- copy 0 - { - # while read curr-value - curr-value:character, exists?:boolean <- next-ingredient - break-unless exists? - capacity <- add capacity, 1 - loop - } - result:address:array:character <- new character:type, capacity - rewind-ingredients - i:number <- copy 0 - { - # while read curr-value - done?:boolean <- greater-or-equal i, capacity - break-if done? - curr-value:character, exists?:boolean <- next-ingredient - assert exists?, [error in rewinding ingredients to new-array] - tmp:address:character <- index-address *result, i - *tmp <- copy curr-value - i <- add i, 1 - loop - } - reply result -] -- cgit 1.4.1-2-gfad0