mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
Map union jet
This commit is contained in:
parent
fef942671f
commit
3ebc69b8cd
3
Makefile
3
Makefile
@ -447,7 +447,8 @@ J164_4_OFILES=\
|
||||
gen164/4/by_gas.o \
|
||||
gen164/4/by_get.o \
|
||||
gen164/4/by_has.o \
|
||||
gen164/4/by_put.o
|
||||
gen164/4/by_put.o \
|
||||
gen164/4/by_uni.o
|
||||
|
||||
J164_5_OFILES=\
|
||||
gen164/5/cue.o \
|
||||
|
@ -11,6 +11,7 @@
|
||||
extern u2_ho_jet j2_mcj(Pt4, by, get)[];
|
||||
extern u2_ho_jet j2_mcj(Pt4, by, has)[];
|
||||
extern u2_ho_jet j2_mcj(Pt4, by, put)[];
|
||||
extern u2_ho_jet j2_mcj(Pt4, by, uni)[];
|
||||
|
||||
/* structures
|
||||
*/
|
||||
@ -20,6 +21,7 @@
|
||||
{ j2_sc(Pt4, by, get), j2_mcj(Pt4, by, get), 0, 0, u2_none },
|
||||
{ j2_sc(Pt4, by, has), j2_mcj(Pt4, by, has), 0, 0, u2_none },
|
||||
{ j2_sc(Pt4, by, put), j2_mcj(Pt4, by, put), 0, 0, u2_none },
|
||||
{ j2_sc(Pt4, by, uni), j2_mcj(Pt4, by, uni), 0, 0, u2_none },
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
u2_noun pn_a, qn_a;
|
||||
|
||||
if ( (u2_no == u2_as_trel(a, &n_a, &l_a, &r_a)) ||
|
||||
(u2_no == u2_as_cell(n_a, &pn_a, &qn_a) ) )
|
||||
(u2_no == u2_as_cell(n_a, &pn_a, &qn_a)) )
|
||||
{
|
||||
return u2_bl_bail(wir_r, c3__exit);
|
||||
}
|
||||
|
56
gen164/4/by_uni.c
Normal file
56
gen164/4/by_uni.c
Normal file
@ -0,0 +1,56 @@
|
||||
/* j/4/uni.c
|
||||
**
|
||||
** This file is in the public domain.
|
||||
*/
|
||||
#include "all.h"
|
||||
#include "../pit.h"
|
||||
|
||||
/* functions
|
||||
*/
|
||||
u2_weak // transfer
|
||||
j2_mcc(Pt4, by, uni)(u2_wire wir_r,
|
||||
u2_noun a, // retain
|
||||
u2_noun b) // retain
|
||||
{
|
||||
if ( u2_nul == b ) {
|
||||
return u2k(a);
|
||||
}
|
||||
else {
|
||||
u2_noun l_b, n_b, r_b;
|
||||
u2_noun pn_b, qn_b;
|
||||
|
||||
if ( (u2_no == u2_as_trel(b, &n_b, &l_b, &r_b)) ||
|
||||
(u2_no == u2_as_cell(n_b, &pn_b, &qn_b)) )
|
||||
{
|
||||
return u2_bl_bail(wir_r, c3__exit);
|
||||
}
|
||||
else {
|
||||
u2_noun l = j2_mcc(Pt4, by, uni)(wir_r, a, l_b);
|
||||
u2_noun r = j2_mcc(Pt4, by, uni)(wir_r, l, r_b);
|
||||
u2_noun z = j2_mcc(Pt4, by, put)(wir_r, r, pn_b, qn_b);
|
||||
|
||||
u2z(l); u2z(r);
|
||||
return z;
|
||||
}
|
||||
}
|
||||
}
|
||||
u2_weak // transfer
|
||||
j2_mc(Pt4, by, uni)(u2_wire wir_r,
|
||||
u2_noun cor) // retain
|
||||
{
|
||||
u2_noun a, b;
|
||||
|
||||
if ( u2_no == u2_mean(cor, u2_cv_sam, &b, u2_cv_con_sam, &a, 0) ) {
|
||||
return u2_bl_bail(wir_r, c3__exit);
|
||||
} else {
|
||||
return j2_mcc(Pt4, by, uni)(wir_r, a, b);
|
||||
}
|
||||
}
|
||||
|
||||
/* structures
|
||||
*/
|
||||
u2_ho_jet
|
||||
j2_mcj(Pt4, by, uni)[] = {
|
||||
{ ".2", c3__lite, j2_mc(Pt4, by, uni), u2_jet_test|u2_jet_live, u2_none, u2_none },
|
||||
{ }
|
||||
};
|
Loading…
Reference in New Issue
Block a user