about summary refs log tree commit diff stats
path: root/072array.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-03-14 01:00:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-03-14 01:00:48 -0700
commit2badd89a58b9666563746d71069abf16f05709ea (patch)
tree779c9feb243fc8d0f33051cd8323fd23f912f373 /072array.mu
parent8b095f802129f8c328a3a4dc3de4443890d34d59 (diff)
downloadmu-2badd89a58b9666563746d71069abf16f05709ea.tar.gz
2778 - fix all layers
Diffstat (limited to '072array.mu')
-rw-r--r--072array.mu40
1 files changed, 0 insertions, 40 deletions
diff --git a/072array.mu b/072array.mu
deleted file mode 100644
index fcd1fcb7..00000000
--- a/072array.mu
+++ /dev/null
@@ -1,40 +0,0 @@
-scenario array-from-args [
-  run [
-    1:address:shared:array:character <- new-array 0, 1, 2
-    2:array:character <- copy *1:address:shared: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
-def new-array -> result:address:shared:array:character [
-  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 <- 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
-  }
-  return result
-]