about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-08-21 20:33:29 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-08-21 20:35:52 -0700
commit6a2edbe8cad4547921fa6d7307af47b5190a2b48 (patch)
tree8189cfb81f5d48b71082d102265e3c5909d27036 /mu.arc
parent6f9bf3a063470d02cfaff0601281e39ee315e6a3 (diff)
downloadmu-6a2edbe8cad4547921fa6d7307af47b5190a2b48.tar.gz
65 - separate op for array indexing
'get' no longer supports that case; that was confusing.
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc7
1 files changed, 4 insertions, 3 deletions
diff --git a/mu.arc b/mu.arc
index 789b30f3..04a6af69 100644
--- a/mu.arc
+++ b/mu.arc
@@ -167,14 +167,15 @@
                          idx (v arg.1))  ; literal integer
                     (if typeinfo.base!array
                       ; array is an integer 'sz' followed by sz elems
-                      (if (is 0 idx)
-                        (m `(,v.base integer))
-                        (array-ref base (- idx 1)))
+                      ; 'get' can only lookup its index
+                      (m `(,v.base integer))
                       ; field index
                       (m `(,(+ v.base
                                (apply + (map sz
                                              (firstn idx typeinfo.base!elems))))
                            ,typeinfo.base!elems.idx))))
+                aref
+                  (array-ref arg.0 (v arg.1))
                 reply
                   (do (= result arg)
                       (break))
06-26 09:20:32 -0700 committer Kartik Agaram <vc@akkartik.com> 2021-06-26 09:20:32 -0700 .' href='/akkartik/mu/commit/html/rpn.mu.html?h=hlt&id=dc5a0acf3feea227d03a98cedf427d2aef462320'>dc5a0acf ^
4254408a ^

372367f5 ^

52e3ea8a ^
372367f5 ^

78357b88 ^
52e3ea8a ^

78357b88 ^
52e3ea8a ^
372367f5 ^
4254408a ^


52e3ea8a ^
4254408a ^




























78357b88 ^
4254408a ^



4106cf75 ^


78357b88 ^
4106cf75 ^

a8fb537a ^
4106cf75 ^






78357b88 ^
4106cf75 ^
dd60caa3 ^


4106cf75 ^


78357b88 ^
f0e146fc ^
78357b88 ^
f0e146fc ^
78357b88 ^

f0e146fc ^



372367f5 ^
78357b88 ^
372367f5 ^
78357b88 ^

f0e146fc ^


78357b88 ^
f0e146fc ^
372367f5 ^
f0e146fc ^

52e3ea8a ^
f0e146fc ^











372367f5 ^
f0e146fc ^
dd60caa3 ^
f0e146fc ^
dd60caa3 ^
f0e146fc ^

78357b88 ^

f0e146fc ^



78357b88 ^
f0e146fc ^

372367f5 ^
dd60caa3 ^
372367f5 ^
f0e146fc ^




78357b88 ^
f0e146fc ^

372367f5 ^
dd60caa3 ^
372367f5 ^
f0e146fc ^




78357b88 ^
f0e146fc ^

372367f5 ^
dd60caa3 ^
372367f5 ^
f0e146fc ^




78357b88 ^
f0e146fc ^


372367f5 ^
f0e146fc ^



dd60caa3 ^

f0e146fc ^
372367f5 ^
f0e146fc ^



dd60caa3 ^


52e3ea8a ^
dd60caa3 ^

372367f5 ^
f0e146fc ^



372367f5 ^
dd60caa3 ^

f0e146fc ^





dd60caa3 ^
52e3ea8a ^
dd60caa3 ^
372367f5 ^

f0e146fc ^

4254408a ^



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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217