diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-17 09:56:04 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-17 09:56:04 -0700 |
commit | 9da1b126cc017e14035b94c4615d211e5bc4bb21 (patch) | |
tree | a69baf5f6b75be08e68003a725d33cd478659b56 /cpp/030length | |
parent | c8087de8d99a4c3c4264eb89e4d0b35a4fb2c816 (diff) | |
download | mu-9da1b126cc017e14035b94c4615d211e5bc4bb21.tar.gz |
1072
Diffstat (limited to 'cpp/030length')
-rw-r--r-- | cpp/030length | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/cpp/030length b/cpp/030length deleted file mode 100644 index b9e3bc3c..00000000 --- a/cpp/030length +++ /dev/null @@ -1,30 +0,0 @@ -:(scenario "array_length") -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:integer <- length 1:array:integer -] -+run: instruction main/4 -+mem: storing 3 in location 5 - -:(before "End Globals") -const int LENGTH = 31; -:(before "End Primitive Recipe Numbers") -Recipe_number["length"] = LENGTH; -assert(Next_recipe_number == LENGTH); -Next_recipe_number++; -:(before "End Primitive Recipe Implementations") -case LENGTH: { - reagent x = canonize(instructions[pc].ingredients[0]); - if (x.types[0] != Type_number["array"]) { - raise << "tried to calculate length of non-array " << x.to_string() << '\n'; - break; - } - vector<int> result; -//? cout << "length: " << x.value << '\n'; //? 1 - result.push_back(Memory[x.value]); - write_memory(instructions[pc].products[0], result); - break; -} |