about summary refs log blame commit diff stats
path: root/cpp/030length
blob: 7b5c52be9420d1081683bbb65240f82f02ee0db0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                     
                      







                                                        
                                                  



                                                     
:(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]);
  vector<int> result;
//?   cout << "length: " << x.value << '\n'; //? 1
  result.push_back(Memory[x.value]);
  write_memory(instructions[pc].products[0], result);
  break;
}
artik.com> 2015-08-23 10:19:23 -0700 2062' href='/akkartik/mu/commit/html/048typecheck.cc.html?h=main&id=90560d7194f3e451ddab9d4033c98d2e6aec977b'>90560d71 ^
9570363a ^




90560d71 ^

9570363a ^


90560d71 ^


9570363a ^

4fe9f5e8 ^

9570363a ^



90560d71 ^
9570363a ^




90560d71 ^
9570363a ^







90560d71 ^
9570363a ^

4fe9f5e8 ^



90560d71 ^
4fe9f5e8 ^


9570363a ^



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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128