native ⍟, fix unit eachd
This commit is contained in:
parent
dfb30b934f
commit
8d21080dd8
@ -128,7 +128,7 @@ B gt_c1(B t, B x) { return c1(rt_merge, x); }
|
|||||||
#define bd(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = N##_c2 ;c(Fun,bi_##N)->c1 = c1_invalid; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
#define bd(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = N##_c2 ;c(Fun,bi_##N)->c1 = c1_invalid; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
||||||
#define bm(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = c2_invalid;c(Fun,bi_##N)->c1 = N##_c1 ; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
#define bm(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = c2_invalid;c(Fun,bi_##N)->c1 = N##_c1 ; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
||||||
|
|
||||||
B bi_add, bi_sub, bi_mul, bi_div, bi_pow, bi_floor, bi_ceil, bi_stile, bi_eq, bi_ne, bi_le, bi_ge, bi_lt, bi_gt, bi_and, bi_or, bi_not, bi_log;
|
B bi_add, bi_sub, bi_mul, bi_div, bi_pow, bi_floor, bi_ceil, bi_stile, bi_eq, bi_ne, bi_le, bi_ge, bi_lt, bi_gt, bi_and, bi_or, bi_not, bi_log;
|
||||||
static inline void arith_init() { ba(add) ba(sub) ba(mul) ba(div) ba(pow) ba(floor) ba(ceil) ba(stile) ba(eq) ba(ne) bd(le) bd(ge) ba(lt) ba(gt) ba(and) ba(or) ba(not) ba(log)
|
static inline void arith_init() { ba(add) ba(sub) ba(mul) ba(div) ba(pow) ba(floor) ba(ceil) ba(stile) ba(eq) ba(ne) bd(le) bd(ge) ba(lt) ba(gt) ba(and) ba(or) ba(not) ba(log)
|
||||||
c(BFn,bi_add)->ident = c(BFn,bi_sub)->ident = c(BFn,bi_or )->ident = c(BFn,bi_ne)->ident = c(BFn,bi_gt)->ident = m_i32(0);
|
c(BFn,bi_add)->ident = c(BFn,bi_sub)->ident = c(BFn,bi_or )->ident = c(BFn,bi_ne)->ident = c(BFn,bi_gt)->ident = m_i32(0);
|
||||||
c(BFn,bi_mul)->ident = c(BFn,bi_div)->ident = c(BFn,bi_and)->ident = c(BFn,bi_eq)->ident = c(BFn,bi_ge)->ident = c(BFn,bi_pow)->ident = c(BFn,bi_not)->ident = m_i32(1);
|
c(BFn,bi_mul)->ident = c(BFn,bi_div)->ident = c(BFn,bi_and)->ident = c(BFn,bi_eq)->ident = c(BFn,bi_ge)->ident = c(BFn,bi_pow)->ident = c(BFn,bi_not)->ident = m_i32(1);
|
||||||
|
|||||||
14
src/h.h
14
src/h.h
@ -127,12 +127,12 @@ char* format_pm1(u8 u) {
|
|||||||
}
|
}
|
||||||
enum PrimMd2 {
|
enum PrimMd2 {
|
||||||
pm2_none,
|
pm2_none,
|
||||||
pm2_val, pm2_fillBy, pm2_catch, // md2.c
|
pm2_val, pm2_repeat, pm2_fillBy, pm2_catch, // md2.c
|
||||||
};
|
};
|
||||||
char* format_pm2(u8 u) {
|
char* format_pm2(u8 u) {
|
||||||
switch(u) {
|
switch(u) {
|
||||||
default: case pf_none: return"(unknown 1-modifier)";
|
default: case pf_none: return"(unknown 1-modifier)";
|
||||||
case pm2_val: return"⊘"; case pm2_fillBy: return"•_fillBy_"; case pm2_catch: return"⎊";
|
case pm2_val: return"⊘"; case pm2_repeat: return"⍟"; case pm2_fillBy: return"•_fillBy_"; case pm2_catch: return"⎊";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,6 +257,7 @@ bool isObj(B x) { return (x.u>>48) == OBJ_TAG; }
|
|||||||
// bool isF64(B x) { return ((x.u>>51&0xFFF) != 0xFFE) | ((x.u<<1)==(b(1.0/0.0).u<<1)); }
|
// bool isF64(B x) { return ((x.u>>51&0xFFF) != 0xFFE) | ((x.u<<1)==(b(1.0/0.0).u<<1)); }
|
||||||
bool isVal(B x) { return (x.u - (((u64)VAL_TAG<<51) + 1)) < ((1ull<<51) - 1); } // ((x.u>>51) == VAL_TAG) & ((x.u<<13) != 0);
|
bool isVal(B x) { return (x.u - (((u64)VAL_TAG<<51) + 1)) < ((1ull<<51) - 1); } // ((x.u>>51) == VAL_TAG) & ((x.u<<13) != 0);
|
||||||
bool isF64(B x) { return (x.u<<1) - ((0xFFEull<<52) + 2) >= (1ull<<52) - 2; }
|
bool isF64(B x) { return (x.u<<1) - ((0xFFEull<<52) + 2) >= (1ull<<52) - 2; }
|
||||||
|
bool isNum(B x) { return isF64(x)|isI32(x); }
|
||||||
|
|
||||||
bool isAtm(B x) { return !isVal(x); }
|
bool isAtm(B x) { return !isVal(x); }
|
||||||
bool noFill(B x);
|
bool noFill(B x);
|
||||||
@ -334,10 +335,11 @@ B m_i32(i32 n) { return m_f64(n); }
|
|||||||
B m_error() { return tag(4, TAG_TAG); }
|
B m_error() { return tag(4, TAG_TAG); }
|
||||||
B m_usz(usz n) { return n==(i32)n? m_i32(n) : m_f64(n); }
|
B m_usz(usz n) { return n==(i32)n? m_i32(n) : m_f64(n); }
|
||||||
|
|
||||||
i32 o2i (B x) { if ((i32)x.f!=x.f) thrM("Expected integer"); return (i32)x.f; }
|
i32 o2i (B x) { if ((i32)x.f!=x.f) thrM("Expected integer"); return (i32)x.f; }
|
||||||
usz o2s (B x) { if ((usz)x.f!=x.f) thrM("Expected integer"); return (usz)x.f; }
|
usz o2s (B x) { if ((usz)x.f!=x.f) thrM("Expected integer"); return (usz)x.f; }
|
||||||
i64 o2i64(B x) { if ((i64)x.f!=x.f) thrM("Expected integer"); return (i64)x.f; }
|
i64 o2i64 (B x) { if ((i64)x.f!=x.f) thrM("Expected integer"); return (i64)x.f; }
|
||||||
i32 o2iu (B x) { return isI32(x)? (i32)(u32)x.u : (i32)x.f; }
|
i32 o2iu (B x) { return isI32(x)? (i32)(u32)x.u : (i32)x.f; }
|
||||||
|
i64 o2i64u(B x) { return (i64)x.f; }
|
||||||
bool q_i32(B x) { return isI32(x) || isF64(x)&(x.f==(i32)x.f); }
|
bool q_i32(B x) { return isI32(x) || isF64(x)&(x.f==(i32)x.f); }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
17
src/main.c
17
src/main.c
@ -96,13 +96,13 @@ int main() {
|
|||||||
|
|
||||||
// fake runtime
|
// fake runtime
|
||||||
B fruntime[] = {
|
B fruntime[] = {
|
||||||
/* +-×÷⋆√⌊⌈|¬ */ bi_add , bi_sub , bi_mul , bi_div, bi_pow, bi_N , bi_floor, bi_ceil, bi_stile, bi_not,
|
/* +-×÷⋆√⌊⌈|¬ */ bi_add , bi_sub , bi_mul , bi_div, bi_pow, bi_N , bi_floor, bi_ceil, bi_stile, bi_not,
|
||||||
/* ∧∨<>≠=≤≥≡≢ */ bi_and , bi_or , bi_lt , bi_gt , bi_ne , bi_eq, bi_le , bi_ge , bi_feq , bi_fne,
|
/* ∧∨<>≠=≤≥≡≢ */ bi_and , bi_or , bi_lt , bi_gt , bi_ne , bi_eq, bi_le , bi_ge , bi_feq , bi_fne,
|
||||||
/* ⊣⊢⥊∾≍↑↓↕«» */ bi_ltack, bi_rtack, bi_shape, bi_N , bi_N , bi_N , bi_N , bi_ud , bi_N , bi_N,
|
/* ⊣⊢⥊∾≍↑↓↕«» */ bi_ltack, bi_rtack , bi_shape, bi_N , bi_N , bi_N , bi_N , bi_ud , bi_N , bi_N,
|
||||||
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ bi_N , bi_N , bi_N , bi_N , bi_N , bi_N , bi_pick , bi_N , bi_N , bi_N,
|
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ bi_N , bi_N , bi_N , bi_N , bi_N , bi_N , bi_pick , bi_N , bi_N , bi_N,
|
||||||
/* ⍷⊔!˙˜˘¨⌜⁼´ */ bi_N , bi_N , bi_asrt , bi_N , bi_N , bi_N , bi_each , bi_tbl , bi_N , bi_fold,
|
/* ⍷⊔!˙˜˘¨⌜⁼´ */ bi_N , bi_N , bi_asrt , bi_N , bi_N , bi_N , bi_each , bi_tbl , bi_N , bi_fold,
|
||||||
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ bi_N , bi_scan , bi_N , bi_N , bi_N , bi_N , bi_N , bi_val , bi_N , bi_N,
|
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ bi_N , bi_scan , bi_N , bi_N , bi_N , bi_N , bi_N , bi_val , bi_N , bi_N,
|
||||||
/* ⚇⍟⎊ */ bi_N , bi_N , bi_catch
|
/* ⚇⍟⎊ */ bi_N , bi_repeat, bi_catch
|
||||||
};
|
};
|
||||||
bool rtComplete[] = {
|
bool rtComplete[] = {
|
||||||
/* +-×÷⋆√⌊⌈|¬ */ 1,1,1,1,1,0,1,1,1,1,
|
/* +-×÷⋆√⌊⌈|¬ */ 1,1,1,1,1,0,1,1,1,1,
|
||||||
@ -111,7 +111,7 @@ int main() {
|
|||||||
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ 0,0,0,0,0,0,0,0,0,0,
|
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ 0,0,0,0,0,0,0,0,0,0,
|
||||||
/* ⍷⊔!˙˜˘¨⌜⁼´ */ 0,0,1,0,0,0,1,1,0,1,
|
/* ⍷⊔!˙˜˘¨⌜⁼´ */ 0,0,1,0,0,0,1,1,0,1,
|
||||||
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ 0,1,0,0,0,0,0,1,0,0,
|
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ 0,1,0,0,0,0,0,1,0,0,
|
||||||
/* ⚇⍟⎊ */ 0,0,1
|
/* ⚇⍟⎊ */ 0,1,1
|
||||||
};
|
};
|
||||||
assert(sizeof(fruntime)/sizeof(B) == rtLen);
|
assert(sizeof(fruntime)/sizeof(B) == rtLen);
|
||||||
for (i32 i = 0; i < rtLen; i++) inc(fruntime[i]);
|
for (i32 i = 0; i < rtLen; i++) inc(fruntime[i]);
|
||||||
@ -133,6 +133,7 @@ int main() {
|
|||||||
rt_sortAsc = rtObjGet(rtObjRaw, 10); gc_add(rt_sortAsc);
|
rt_sortAsc = rtObjGet(rtObjRaw, 10); gc_add(rt_sortAsc);
|
||||||
rt_sortDsc = rtObjGet(rtObjRaw, 11); gc_add(rt_sortDsc);
|
rt_sortDsc = rtObjGet(rtObjRaw, 11); gc_add(rt_sortDsc);
|
||||||
rt_merge = rtObjGet(rtObjRaw, 13); gc_add(rt_merge);
|
rt_merge = rtObjGet(rtObjRaw, 13); gc_add(rt_merge);
|
||||||
|
rt_undo = rtObjGet(rtObjRaw, 48); gc_add(rt_undo);
|
||||||
|
|
||||||
for (usz i = 0; i < runtimeLen; i++) {
|
for (usz i = 0; i < runtimeLen; i++) {
|
||||||
#ifdef ALL_RUNTIME
|
#ifdef ALL_RUNTIME
|
||||||
|
|||||||
@ -120,7 +120,7 @@ B fold_c2(B d, B w, B x) { B f = c(Md1D,d)->f;
|
|||||||
|
|
||||||
void print_md1_def(B x) { printf("%s", format_pm1(c(Md1,x)->extra)); }
|
void print_md1_def(B x) { printf("%s", format_pm1(c(Md1,x)->extra)); }
|
||||||
|
|
||||||
B bi_tbl, bi_each, bi_fold, bi_scan;
|
B bi_tbl, bi_each, bi_fold, bi_scan;
|
||||||
static inline void md1_init() { ba(tbl) ba(each) ba(fold) ba(scan)
|
static inline void md1_init() { ba(tbl) ba(each) ba(fold) ba(scan)
|
||||||
ti[t_md1BI].print = print_md1_def;
|
ti[t_md1BI].print = print_md1_def;
|
||||||
}
|
}
|
||||||
|
|||||||
63
src/md2.c
63
src/md2.c
@ -35,14 +35,73 @@ B catch_c1 (B d, B x) { return c1(c(Md2D,d)->f, x); }
|
|||||||
B catch_c2 (B d, B w, B x) { return c2(c(Md2D,d)->f, w,x); }
|
B catch_c2 (B d, B w, B x) { return c2(c(Md2D,d)->f, w,x); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
B rt_undo;
|
||||||
|
void repeat_bounds(i64* bound, B g) { // doesn't consume
|
||||||
|
if (isArr(g)) {
|
||||||
|
BS2B xgetU = TI(g).getU;
|
||||||
|
usz ia = a(g)->ia;
|
||||||
|
for (usz i = 0; i < ia; i++) repeat_bounds(bound, xgetU(g, i));
|
||||||
|
} else if (isNum(g)) {
|
||||||
|
i64 i = o2i64(g);
|
||||||
|
if (i<bound[0]) bound[0] = i;
|
||||||
|
if (i>bound[1]) bound[1] = i;
|
||||||
|
} else thrM("⍟: 𝔽 contained a non-number atom");
|
||||||
|
}
|
||||||
|
B repeat_replace(B g, B* q) { // doesn't consume
|
||||||
|
if (isArr(g)) {
|
||||||
|
BS2B ggetU = TI(g).getU;
|
||||||
|
usz ia = a(g)->ia;
|
||||||
|
HArr_p r = m_harrc(g);
|
||||||
|
for (usz i = 0; i < ia; i++) r.a[i] = repeat_replace(ggetU(g,i), q);
|
||||||
|
return r.b;
|
||||||
|
} else {
|
||||||
|
return inc(q[o2i64u(g)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#define REPEAT_T(CN, END, ...) \
|
||||||
|
B g = CN(c(Md2D,d)->g, __VA_ARGS__ inc(x)); \
|
||||||
|
B f = c(Md2D,d)->f; \
|
||||||
|
if (isNum(g)) { \
|
||||||
|
i64 am = o2i64(g); \
|
||||||
|
if (am>=0) { \
|
||||||
|
for (i64 i = 0; i < am; i++) x = CN(f, __VA_ARGS__ x); \
|
||||||
|
END; \
|
||||||
|
return x; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
i64 bound[2] = {0,0}; \
|
||||||
|
repeat_bounds(bound, g); \
|
||||||
|
u64 min = -bound[0]; u64 max = bound[1]; \
|
||||||
|
B all[min+max+1]; \
|
||||||
|
B* q = all+min; \
|
||||||
|
q[0] = inc(x); \
|
||||||
|
if (min) { \
|
||||||
|
B x2 = inc(x); \
|
||||||
|
B fi = m1_d(inc(rt_undo), inc(f)); \
|
||||||
|
for (i64 i = 0; i < min; i++) q[-1-i] = inc(x2 = CN(fi, __VA_ARGS__ x2)); \
|
||||||
|
dec(x2); \
|
||||||
|
dec(fi); \
|
||||||
|
} \
|
||||||
|
for (i64 i = 0; i < max; i++) q[i+1] = inc(x = CN(f, __VA_ARGS__ x)); \
|
||||||
|
dec(x); \
|
||||||
|
B r = repeat_replace(g, q); \
|
||||||
|
dec(g); \
|
||||||
|
for (i64 i = 0; i < min+max+1; i++) dec(all[i]); \
|
||||||
|
END; \
|
||||||
|
return r;
|
||||||
|
|
||||||
|
B repeat_c1(B d, B x) { REPEAT_T(c1,{} ); }
|
||||||
|
B repeat_c2(B d, B w, B x) { REPEAT_T(c2,dec(w), inc(w), ); }
|
||||||
|
#undef REPEAT_T
|
||||||
|
|
||||||
#define ba(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = NAME##_c2; c(Md2,bi_##NAME)->c1 = NAME##_c1; c(Md2,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
#define ba(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = NAME##_c2; c(Md2,bi_##NAME)->c1 = NAME##_c1; c(Md2,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
||||||
#define bd(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = NAME##_c2; c(Md2,bi_##NAME)->c1 = c1_invalid; c(Md1,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
#define bd(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = NAME##_c2; c(Md2,bi_##NAME)->c1 = c1_invalid; c(Md1,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
||||||
#define bm(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = c2_invalid;c(Md2,bi_##NAME)->c1 = NAME##_c1; c(Md1,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
#define bm(NAME) bi_##NAME = mm_alloc(sizeof(Md2), t_md2BI, ftag(MD2_TAG)); c(Md2,bi_##NAME)->c2 = c2_invalid;c(Md2,bi_##NAME)->c1 = NAME##_c1; c(Md1,bi_##NAME)->extra=pm2_##NAME; gc_add(bi_##NAME);
|
||||||
|
|
||||||
void print_md2_def(B x) { printf("%s", format_pm2(c(Md1,x)->extra)); }
|
void print_md2_def(B x) { printf("%s", format_pm2(c(Md1,x)->extra)); }
|
||||||
|
|
||||||
B bi_val, bi_fillBy, bi_catch;
|
B bi_val, bi_repeat, bi_fillBy, bi_catch;
|
||||||
static inline void md2_init() { ba(val) ba(fillBy) ba(catch)
|
static inline void md2_init() { ba(val) ba(repeat) ba(fillBy) ba(catch)
|
||||||
ti[t_md2BI].print = print_md2_def;
|
ti[t_md2BI].print = print_md2_def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ B eachd_fn(BBB2B f, B fo, B w, B x) { // consumes w,x; assumes at least one is a
|
|||||||
bool wg = wr>xr;
|
bool wg = wr>xr;
|
||||||
ur rM = wg? wr : xr;
|
ur rM = wg? wr : xr;
|
||||||
ur rm = wg? xr : wr;
|
ur rm = wg? xr : wr;
|
||||||
if (rM==0) return f(fo, wget(w,0), xget(x,0));
|
if (rM==0) { B r = f(fo, wget(w,0), xget(x,0)); dec(w); dec(x); return m_unit(r); }
|
||||||
if (isArr(w) & isArr(x) && !eqShPrefix(a(w)->sh, a(x)->sh, rm)) thrM("Mapping: Expected equal shape prefix");
|
if (isArr(w) & isArr(x) && !eqShPrefix(a(w)->sh, a(x)->sh, rm)) thrM("Mapping: Expected equal shape prefix");
|
||||||
bool rw = rM==wr && ((v(w)->type==t_harr) & reusable(w)); // v(…) is safe as rank>0
|
bool rw = rM==wr && ((v(w)->type==t_harr) & reusable(w)); // v(…) is safe as rank>0
|
||||||
bool rx = rM==xr && ((v(x)->type==t_harr) & reusable(x));
|
bool rx = rM==xr && ((v(x)->type==t_harr) & reusable(x));
|
||||||
@ -272,7 +272,7 @@ B funBI_identity(B x) {
|
|||||||
|
|
||||||
void print_fun_def(B x) { printf("%s", format_pf(c(Fun,x)->extra)); }
|
void print_fun_def(B x) { printf("%s", format_pf(c(Fun,x)->extra)); }
|
||||||
|
|
||||||
B bi_shape, bi_pick, bi_ud, bi_pair, bi_fne, bi_feq, bi_ltack, bi_rtack, bi_fmtF, bi_fmtN;
|
B bi_shape, bi_pick, bi_ud, bi_pair, bi_fne, bi_feq, bi_ltack, bi_rtack, bi_fmtF, bi_fmtN;
|
||||||
static inline void sfns_init() { ba(shape) ba(pick) bm(ud) ba(pair) ba(fne) ba(feq) ba(ltack) ba(rtack) bm(fmtF) bm(fmtN)
|
static inline void sfns_init() { ba(shape) ba(pick) bm(ud) ba(pair) ba(fne) ba(feq) ba(ltack) ba(rtack) bm(fmtF) bm(fmtN)
|
||||||
ti[t_funBI].print = print_fun_def;
|
ti[t_funBI].print = print_fun_def;
|
||||||
ti[t_funBI].identity = funBI_identity;
|
ti[t_funBI].identity = funBI_identity;
|
||||||
|
|||||||
@ -135,7 +135,7 @@ B sys_c1(B t, B x);
|
|||||||
#define bd(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = N##_c2 ;c(Fun,bi_##N)->c1 = c1_invalid; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
#define bd(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = N##_c2 ;c(Fun,bi_##N)->c1 = c1_invalid; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
||||||
#define bm(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = c2_invalid;c(Fun,bi_##N)->c1 = N##_c1 ; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
#define bm(N) bi_##N = mm_alloc(sizeof(BFn), t_funBI, ftag(FUN_TAG)); c(Fun,bi_##N)->c2 = c2_invalid;c(Fun,bi_##N)->c1 = N##_c1 ; c(Fun,bi_##N)->extra=pf_##N; c(BFn,bi_##N)->ident=bi_N; gc_add(bi_##N);
|
||||||
|
|
||||||
B bi_type, bi_decp, bi_primInd, bi_glyph, bi_fill, bi_grLen, bi_grOrd, bi_asrt, bi_sys, bi_internal;
|
B bi_type, bi_decp, bi_primInd, bi_glyph, bi_fill, bi_grLen, bi_grOrd, bi_asrt, bi_sys, bi_internal;
|
||||||
static inline void sysfn_init() { bm(type) bm(decp) bm(primInd) bm(glyph) ba(fill) ba(grLen) bd(grOrd) ba(asrt) bm(sys) bd(internal) }
|
static inline void sysfn_init() { bm(type) bm(decp) bm(primInd) bm(glyph) ba(fill) ba(grLen) bd(grOrd) ba(asrt) bm(sys) bd(internal) }
|
||||||
|
|
||||||
#undef ba
|
#undef ba
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user