diff --git a/Makefile b/Makefile index 8aaceb10fe..4ccd5bb4ae 100644 --- a/Makefile +++ b/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 \ diff --git a/gen164/4/by.c b/gen164/4/by.c index f4bcd2e37e..d06a45a79b 100644 --- a/gen164/4/by.c +++ b/gen164/4/by.c @@ -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 }, {} }; diff --git a/gen164/4/by_has.c b/gen164/4/by_has.c index aa4dbae69f..b39abf1a8e 100644 --- a/gen164/4/by_has.c +++ b/gen164/4/by_has.c @@ -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); } diff --git a/gen164/4/by_uni.c b/gen164/4/by_uni.c new file mode 100644 index 0000000000..8f38db2e40 --- /dev/null +++ b/gen164/4/by_uni.c @@ -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 }, + { } + };