about summary refs log tree commit diff stats
path: root/cpp/033length.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/033length.cc')
-rw-r--r--cpp/033length.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/cpp/033length.cc b/cpp/033length.cc
deleted file mode 100644
index 126a14e7..00000000
--- a/cpp/033length.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-//: Recipe to compute the length of an array.
-
-:(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 Primitive Recipe Declarations")
-LENGTH,
-:(before "End Primitive Recipe Numbers")
-Recipe_number["length"] = LENGTH;
-:(before "End Primitive Recipe Implementations")
-case LENGTH: {
-  reagent x = canonize(current_instruction().ingredients[0]);
-  if (x.types[0] != Type_number["array"]) {
-    raise << "tried to calculate length of non-array " << x.to_string() << '\n';
-    break;
-  }
-  vector<long long int> result;
-//?   cout << "length: " << x.value << '\n'; //? 1
-  result.push_back(Memory[x.value]);
-  write_memory(current_instruction().products[0], result);
-  break;
-}
e.mu?h=hlt&id=af7a5722df4b71f679bd2bae40601916682bbb59'>^
20d1c905 ^

662d2a27 ^
20d1c905 ^
ce87c19e ^

bc643692 ^
20d1c905 ^

662d2a27 ^
20d1c905 ^
ce87c19e ^

32241605 ^
20d1c905 ^


bc643692 ^
5497090a ^
20d1c905 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36