diff --git a/include/jets/q.h b/include/jets/q.h index 6fd6e21dac..48db0ea5e7 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -217,6 +217,7 @@ u3_noun u3qfp_hack(u3_noun, u3_noun); u3_noun u3qfp_late(u3_noun); u3_noun u3qfp_open(u3_noun, u3_noun); + u3_noun u3qfp_nepo(u3_noun, u3_noun); u3_noun u3qfp_rake(u3_noun); # define u3qfu_van_fan 28 @@ -294,6 +295,7 @@ u3_noun u3qzp_hack(u3_noun, u3_noun); u3_noun u3qzp_late(u3_noun); u3_noun u3qzp_open(u3_noun, u3_noun); + u3_noun u3qzp_nepo(u3_noun, u3_noun); u3_noun u3qzp_rake(u3_noun); # define u3qzu_van_fan 28 diff --git a/jets/f/ap.c b/jets/f/ap.c index 1ad3180722..953652c936 100644 --- a/jets/f/ap.c +++ b/jets/f/ap.c @@ -1039,3 +1039,59 @@ return u3qfp_open(ter, gen); } } + +/* boilerplate + * +*/ + static u3_noun + _aq_core(u3_noun ter, + u3_noun gen) + { + u3_noun gat = u3j_hook(u3k(ter), "ap"); + + return u3i_molt(gat, u3x_sam, u3k(gen), 0); + } + +/* open +*/ + static u3_noun + _aq_open_n(u3_noun ter, + u3_noun gen) + { + u3_noun cor = _aq_core(ter, gen); + + return u3j_soft(cor, "open"); + } + static u3_noun + _aq_open_l(u3_noun ter, + u3_noun gen) + { + u3_noun pro = _open_in(ter, gen); + + if ( u3_none != pro ) { + return pro; + } else { + return _aq_open_n(ter, gen); + } + } + + u3_noun + u3qfp_nepo(u3_noun ter, + u3_noun gen) + { + return _aq_open_l(ter, gen); + } + + u3_noun + u3wfp_nepo(u3_noun cor) + { + u3_noun gen; + + if ( u3_none == (gen = u3r_at(u3x_sam, cor)) ) { + return u3m_bail(c3__fail); + } else { + u3_noun ter = u3r_at(u3x_con, cor); + + return u3qfp_nepo(ter, gen); + } + } diff --git a/jets/f/ut_mint.c b/jets/f/ut_mint.c index 5ea4da85e1..c5c0943c57 100644 --- a/jets/f/ut_mint.c +++ b/jets/f/ut_mint.c @@ -388,8 +388,10 @@ } if ( c3n == u3du(gen) ) { + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun rex = u3qfp_open(ter, gen); + u3_noun rex = (c3n == fab) ? u3qfp_nepo(ter, gen) + : u3qfp_open(ter, gen); ret = _mint_in(van, sut, gol, rex); u3z(rex); @@ -414,8 +416,10 @@ } } else switch ( u3h(gen) ) { default: { + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun rex = u3qfp_open(ter, gen); + u3_noun rex = (c3n == fab) ? u3qfp_nepo(ter, gen) + : u3qfp_open(ter, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 @@ -813,7 +817,6 @@ case c3__ktcn: p_gen = u3t(gen); _mint_used(); -#if 0 { u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); u3_noun ret = _mint_in(von, sut, gol, p_gen); @@ -821,33 +824,9 @@ u3z(von); return ret; } -#else - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "blow"); - u3_noun pro; - - pro = u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_3, - u3k(p_gen), - 0)); - return pro; - } -#endif case c3__cold: p_gen = u3t(gen); _mint_used(); -#if 0 - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _mint_in(von, sut, gol, p_gen); - - u3z(von); - return ret; - } -#else { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); u3_noun gat = u3j_hook(von, "blow"); @@ -861,7 +840,6 @@ 0)); return pro; } -#endif case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); diff --git a/jets/f/ut_mull.c b/jets/f/ut_mull.c index 830eba88bf..203b674e88 100644 --- a/jets/f/ut_mull.c +++ b/jets/f/ut_mull.c @@ -340,8 +340,10 @@ u3_noun ret; if ( c3n == u3du(gen) ) { + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun rex = u3qfp_open(ter, gen); + u3_noun rex = (c3n == fab) ? u3qfp_nepo(ter, gen) + : u3qfp_open(ter, gen); ret = _mull_in(van, sut, gol, dox, rex); u3z(rex); @@ -365,8 +367,10 @@ } else switch ( u3h(gen) ) { default: { + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun rex = u3qfp_open(ter, gen); + u3_noun rex = (c3n == fab) ? u3qfp_nepo(ter, gen) + : u3qfp_open(ter, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 diff --git a/jets/f/ut_play.c b/jets/f/ut_play.c index b0b59aa054..124d625d2d 100644 --- a/jets/f/ut_play.c +++ b/jets/f/ut_play.c @@ -216,8 +216,10 @@ if ( c3n == u3du(gen) ) { open: { + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun rex = u3qfp_open(ter, gen); + u3_noun rex = (c3n == fab) ? u3qfp_nepo(ter, gen) + : u3qfp_open(ter, gen); u3_noun ret; if ( c3y == u3r_sing(rex, gen) ) {