diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
commit | b96af395b9af2ff9df94b3e82213171f30827c8d (patch) | |
tree | 17c8c12648ccc25625e2534ec8d74fbe8f1542cc /cpp/062array.mu | |
parent | 2e3b597fe85b654e82b891c22d50754fa5a26156 (diff) | |
download | mu-b96af395b9af2ff9df94b3e82213171f30827c8d.tar.gz |
1276 - make C++ version the default
I've tried to update the Readme, but there are at least a couple of issues.
Diffstat (limited to 'cpp/062array.mu')
-rw-r--r-- | cpp/062array.mu | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/cpp/062array.mu b/cpp/062array.mu deleted file mode 100644 index 95af1412..00000000 --- a/cpp/062array.mu +++ /dev/null @@ -1,40 +0,0 @@ -scenario array-from-args [ - run [ - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ] - memory-should-contain [ - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ] -] - -# create an array out of a list of scalar args -recipe init-array [ - default-space:address:array:location <- new location:type, 30:literal - capacity:integer <- copy 0:literal - { - # while read curr-value - curr-value:location, exists?:boolean <- next-ingredient - break-unless exists?:boolean - capacity:integer <- add capacity:integer, 1:literal - loop - } - result:address:array:location <- new location:type, capacity:integer - rewind-ingredients - i:integer <- copy 0:literal - { - # while read curr-value - done?:boolean <- greater-or-equal i:integer, capacity:integer - break-if done?:boolean - curr-value:location, exists?:boolean <- next-ingredient - assert exists?:boolean, [error in rewinding ingredients to init-array] - tmp:address:location <- index-address result:address:array:location/deref, i:integer - tmp:address:location/deref <- copy curr-value:location - i:integer <- add i:integer, 1:literal - loop - } - reply result:address:array:location -] |