native ⊑ (without array 𝕨)
This commit is contained in:
parent
67e93ae37a
commit
94bf7ccce0
@ -53,7 +53,7 @@ static inline void load_init() {
|
|||||||
/* +-×÷⋆√⌊⌈|¬ */ 1,1,1,1,1,0,1,1,1,1,
|
/* +-×÷⋆√⌊⌈|¬ */ 1,1,1,1,1,0,1,1,1,1,
|
||||||
/* ∧∨<>≠=≤≥≡≢ */ 1,1,1,1,1,1,1,1,1,1,
|
/* ∧∨<>≠=≤≥≡≢ */ 1,1,1,1,1,1,1,1,1,1,
|
||||||
/* ⊣⊢⥊∾≍↑↓↕«» */ 1,1,0,1,1,0,0,1,1,1,
|
/* ⊣⊢⥊∾≍↑↓↕«» */ 1,1,0,1,1,0,0,1,1,1,
|
||||||
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ 0,0,1,1,0,1,0,0,0,0,
|
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ 0,0,1,1,0,1,1,0,0,0,
|
||||||
/* ⍷⊔!˙˜˘¨⌜⁼´ */ 0,0,1,1,1,0,1,1,0,1,
|
/* ⍷⊔!˙˜˘¨⌜⁼´ */ 0,0,1,1,1,0,1,1,0,1,
|
||||||
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ 0,1,1,1,1,1,0,1,0,0,
|
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ 0,1,1,1,1,1,0,1,0,0,
|
||||||
/* ⚇⍟⎊ */ 0,1,1
|
/* ⚇⍟⎊ */ 0,1,1
|
||||||
@ -100,6 +100,7 @@ static inline void load_init() {
|
|||||||
rt_join = rtObjGet(rtObjRaw, 23); gc_add(rt_join);
|
rt_join = rtObjGet(rtObjRaw, 23); gc_add(rt_join);
|
||||||
rt_gradeUp = rtObjGet(rtObjRaw, 33); gc_add(rt_gradeUp);
|
rt_gradeUp = rtObjGet(rtObjRaw, 33); gc_add(rt_gradeUp);
|
||||||
rt_ud = rtObjGet(rtObjRaw, 27); gc_add(rt_ud);
|
rt_ud = rtObjGet(rtObjRaw, 27); gc_add(rt_ud);
|
||||||
|
rt_pick = rtObjGet(rtObjRaw, 36); gc_add(rt_pick);
|
||||||
|
|
||||||
for (usz i = 0; i < runtimeLen; i++) {
|
for (usz i = 0; i < runtimeLen; i++) {
|
||||||
#ifdef ALL_R1
|
#ifdef ALL_R1
|
||||||
|
|||||||
20
src/sfns.c
20
src/sfns.c
@ -173,12 +173,12 @@ B shape_c2(B t, B w, B x) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
B rt_pick;
|
||||||
B pick_c1(B t, B x) {
|
B pick_c1(B t, B x) {
|
||||||
if (isAtm(x)) return x;
|
if (isAtm(x)) return x;
|
||||||
if (a(x)->ia==0) {
|
if (a(x)->ia==0) {
|
||||||
B r = getFillQ(x);
|
B r = getFillE(x);
|
||||||
dec(x);
|
dec(x);
|
||||||
if (noFill(r)) thrM("⊑: called on empty array without fill");
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
B r = TI(x).get(x, 0);
|
B r = TI(x).get(x, 0);
|
||||||
@ -186,12 +186,16 @@ B pick_c1(B t, B x) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
B pick_c2(B t, B w, B x) {
|
B pick_c2(B t, B w, B x) {
|
||||||
// usz wu = o2s(w);
|
if (isNum(w) && isArr(x) && rnk(x)==1) {
|
||||||
// if (isAtm(x)) { dec(x); dec(w); thrM("⊑: 𝕩 wasn't an array"); }
|
i64 p = o2i64(w);
|
||||||
// if (wu >= a(x)->ia) thrM("⊑: 𝕨 is greater than length of 𝕩"); // no bounds check for now
|
usz xia = a(x)->ia;
|
||||||
B r = TI(x).get(x, o2su(w));
|
if (p<0) p+= (i64)xia;
|
||||||
dec(x);
|
if ((u64)p >= xia) thrM("⊑: indexing out-of-bounds");
|
||||||
return r;
|
B r = TI(x).get(x, p);
|
||||||
|
dec(x);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
return c2(rt_pick, w, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
B rt_select;
|
B rt_select;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user