Map union jet

This commit is contained in:
Steve Dee 2014-04-15 13:07:11 -07:00
parent fef942671f
commit 3ebc69b8cd
4 changed files with 61 additions and 2 deletions

View File

@ -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 \

View File

@ -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 },
{}
};

View File

@ -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
View 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 },
{ }
};