Skip to content

Commit 6709ed2

Browse files
committed
outdexing
1 parent b4158e9 commit 6709ed2

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func Amd(x, i, v, y K) K {
114114
xt := tp(x)
115115
if xt == st {
116116
a := lup(x)
117-
if rc := I32(int32(a)-4); rc == 2 { //enable reuse for @[`x;i;+;y]
117+
if rc := I32(int32(a) - 4); rc == 2 { //enable reuse for @[`x;i;+;y]
118118
dx(a)
119119
p := int32(a)
120120
a = rx(Amd(a, i, v, y))

index.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ func stv(x, i, y K) K {
198198
for j := int32(0); j < n; j++ {
199199
xi := uint32(I32(ip + 4*j))
200200
if xi >= uint32(xn) {
201-
trap() //index
201+
j := rx(Wer(Min(Mor(rx(i), Ki(-1)), Les(rx(i), Ki(xn)))))
202+
return stv(x, atv(i, j), atv(y, j))
202203
}
203204
}
204205
switch s >> 2 {
@@ -246,7 +247,8 @@ func stv(x, i, y K) K {
246247
func sti(x K, i int32, y K) K {
247248
xt := tp(x)
248249
if uint32(i) >= uint32(nn(x)) {
249-
trap() //index
250+
dx(y)
251+
return x
250252
}
251253
s := sz(xt)
252254
xp := int32(x)

k.e

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ log[2a45;3] /Type
7070
+/`a`b`c /Type
7171
*/`a`b`c /Type
7272
@[!10;!3;!4] /Length
73-
@[!10;10;4] /Index
74-
@[!10;8+!3;1 2 3] /Index
7573
@[1 2 3;0 1.;4 5] /Type
7674
2000000000#"a" /Grow
7775
2000000000#1a /Grow

k.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ v:{$[1<#x;j@*x;x]};j:{v x};j(1;2 3) /1
554554
@[("abc";"def");!0;,"ghi"] /("abc";"def")
555555
@[!10;(1 2;3 4 5);-1] /0 -1 -1 -1 -1 -1 6 7 8 9
556556
@[!10;(1 2;3 4 5);-1 -2] /0 -1 -1 -2 -2 -2 6 7 8 9
557+
@[!10;8+!3;1 2 3] /0 1 2 3 4 5 6 7 1 2
557558
x:!5;@[`x;0 1 2;*;2];x /0 2 4 3 4
558559
.[2^!6;1 2;9] /(0 1 2;3 4 9)
559560
.[2^!6;1 2;9 9] /(0 1 2;(3;4;9 9))
@@ -574,6 +575,7 @@ x:(!5;2*!5);.[`x;(1;2 3);*;2];x /(0 1 2 3 4;0 2 8 12 8)
574575
x:2^!6;x[1;2]:0;x /(0 1 2;3 4 0)
575576
x:!5;x[2]:2. 3.;x /(0;1;2. 3.;3;4)
576577
x:!5;x[2 3]:2. 3.;x /(0;1;2.;3.;4)
578+
x:!3;x[5]:6;x /0 1 2
577579
d:`a`b!1 2;d[`a]:3;d /`a`b!3 2
578580
@[2 3!4 5;3;+;1] /2 3!4 6
579581
d:`a`b!(1 2!3 4;5);d[`a;2 1]:3 4;d /`a`b!(1 2!4 3;5)

0 commit comments

Comments
 (0)