From 67d51c1c1fdae499db2c157b6e34dd0ac828ba7d Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 14:25:19 -0700 Subject: [PATCH 01/23] decapitate crop:ut --- pkg/urbit/jets/f/ut_crop.c | 233 +------------------------------------ 1 file changed, 6 insertions(+), 227 deletions(-) diff --git a/pkg/urbit/jets/f/ut_crop.c b/pkg/urbit/jets/f/ut_crop.c index 043484d75a..67e079bd64 100644 --- a/pkg/urbit/jets/f/ut_crop.c +++ b/pkg/urbit/jets/f/ut_crop.c @@ -3,237 +3,16 @@ */ #include "all.h" -/* logic -*/ - static u3_noun - _crop_dext(u3_noun, u3_noun, u3_noun, u3_noun); - static u3_noun - _crop_sint(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _crop_repo(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun rep = u3qfu_repo(van, sut); - u3_noun ret = _crop_dext(van, rep, ref, bix); - - if ( c3y == u3r_sing(ret, rep) ) { - if ( c3__void == rep ) { - return c3__void; - } else { - u3z(rep); - u3z(ret); - return u3k(sut); - } - } else { - u3z(rep); - return ret; - } - } - - static u3_noun - _crop_dext_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_crop_dext(van, u3h(p_sut), ref, bix), - _crop_dext_fork(van, u3t(p_sut), ref, bix)); - } - } - static u3_noun - _crop_sint_fork(u3_noun van, u3_noun sut, u3_noun p_ref, u3_noun bix) - { - if ( u3_nul == p_ref ) { - return u3k(sut); - } - else { - u3_noun tuz = _crop_dext(van, sut, u3h(p_ref), bix); - u3_noun zat = _crop_sint_fork(van, tuz, u3t(p_ref), bix); - - u3z(tuz); - return zat; - } - } - - static u3_noun - _crop_dext(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - - if ( c3n == u3du(ref) ) { - switch ( ref ) { - case c3__void: return u3k(sut); - case c3__noun: return c3__void; - default: return u3m_bail(c3__fail); - } - } - if ( c3y == u3r_sing(sut, ref) ) { - return c3__void; - } - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: return _crop_repo(van, sut, ref, bix); - case c3__void: return c3__void; - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3__atom == u3h(ref) ) { - u3x_cell(u3t(ref), &p_ref, &q_ref); - - if ( c3y == u3du(q_sut) ) { - if ( c3y == u3du(q_ref) ) { - if ( c3y == u3r_sing(q_sut, q_ref) ) { - return c3__void; - } else { - return u3k(sut); - } - } else { - return c3__void; - } - } - else { - if ( c3y == u3du(q_ref) ) { - return u3k(sut); - } - else return c3__void; - } - } - else if ( c3__cell == u3h(ref) ) { - return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3__atom == u3h(ref) ) { - return u3k(sut); - } - else if ( c3__cell == u3h(ref) ) { - u3x_cell(u3t(ref), &p_ref, &q_ref); - - if ( c3y == u3qfu_nest(van, p_ref, c3n, p_sut) ) - { - u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); - u3_noun ret = u3qf_cell(p_sut, foz); - - u3z(foz); - return ret; - } - else return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__core: - { - if ( (c3__atom == u3h(ref)) || - (c3__cell == u3h(ref)) ) { - return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun foz = _crop_dext(van, q_sut, ref, bix); - u3_noun ret = u3qf_hint(p_sut, foz); - - u3z(foz); - return ret; - } - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun foz = _crop_dext(van, q_sut, ref, bix); - u3_noun ret = u3qf_face(p_sut, foz); - - u3z(foz); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( c3y == u3qdi_has(bix, hud) ) { -# if 0 - u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_dunq(van, "over", ref); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -# endif - - return u3m_error("crop-loop"); - } else { - u3_noun bux = u3qdi_put(bix, hud); - u3_noun ret = _crop_repo(van, sut, ref, bux); - - u3z(hud); - u3z(bux); - return ret; - } - } - } - } - - static u3_noun - _crop_sint(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_ref, q_ref; - - switch ( u3h(ref) ) { - default: return u3m_bail(c3__fail); - - case c3__core: - case c3__hint: - case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref); - { - return _crop_dext(van, sut, q_ref, bix); - } - case c3__fork: p_ref = u3t(ref); - { - u3_noun yed = u3qdi_tap(p_ref); - u3_noun ret = _crop_sint_fork(van, sut, yed, bix); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun rep = u3qfu_repo(van, ref); - u3_noun ret = _crop_dext(van, sut, rep, bix); - - u3z(rep); - return ret; - } - } - } - static u3_noun _cqfu_crop(u3_noun van, u3_noun sut, u3_noun ref) { - return _crop_dext(van, sut, ref, u3_nul); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_crop-crop", von, "crop"); + gat = u3i_molt(gat, u3x_sam, u3k(ref), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -248,7 +27,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_crop(van, sut, ref); + return u3qfu_crop(van, sut, ref); } } From 0d97cee2ee20b7fa7ec90f713c7e83f40392a152 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 14:47:49 -0700 Subject: [PATCH 02/23] decapitate find:ut, fond:ut --- pkg/urbit/jets/f/ut_find.c | 826 +------------------------------------ 1 file changed, 10 insertions(+), 816 deletions(-) diff --git a/pkg/urbit/jets/f/ut_find.c b/pkg/urbit/jets/f/ut_find.c index faa50a70bd..090805cff5 100644 --- a/pkg/urbit/jets/f/ut_find.c +++ b/pkg/urbit/jets/f/ut_find.c @@ -3,801 +3,18 @@ */ #include "all.h" - static u3_noun - _find_buck(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil); - -/* `u3qfu_felt_arm` is a helper function for - * u3qfu_felt. It handles the case in which the - * opal is for an arm, by creating a list of - * parent core types. These will be converted to - * a single `fork` type. -*/ - static u3_noun - u3qfu_felt_arm(u3_noun lis) - { - if ( u3_nul == lis ) { - return u3_nul; - } - else { - u3_noun i_lis, t_lis, fot, typ; - u3x_cell(lis, &i_lis, &t_lis); - u3x_cell(i_lis, &typ, &fot); - - if ( (c3n == u3du(typ)) || - (c3__core != u3h(typ)) ) { - return u3m_error("felt-core"); - } - else { - u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; - u3x_cell(u3t(typ), &p_typ, &q_typ); - u3x_trel(q_typ, &pq_typ, &qq_typ, &rq_typ); - - u3_noun dox = u3nt(c3__core, u3k(qq_typ), u3k(q_typ)); - return u3nc(dox, u3qfu_felt_arm(t_lis)); - } - } - } - -/* `u3qfu_felt` takes an opal, lap, and converts - * it to a type. The opal comes from the last - * limb of the wing processed by `+fond`. The - * type is used in +fond as the subject type of - * the next limb in the wing. -*/ - static u3_noun - u3qfu_felt(u3_noun lap) - { - u3_noun lim, mil; - u3x_cell(lap, &lim, &mil); - - if ( c3y == lim ) { - return u3k(mil); - } - else if ( c3n == lim ) { - u3_noun p_lap, q_lap, lis, hos; - u3x_cell(mil, &p_lap, &q_lap); - lis = u3qdi_tap(q_lap); - hos = u3qfu_felt_arm(lis); - - u3z(lis); - return u3kf_fork(hos); - } - else { - u3m_bail(c3__exit); - } - } - - static u3_noun - u3qfu_fund(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(way), - u3x_sam_3, - u3k(gen), - 0)); - } - - static u3_noun - u3qfu_fine(u3_noun van, - u3_noun sut, - u3_noun tor) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(tor), - 0)); - } - - static u3_noun - _find_buck_here(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( 0 == p_heg ) { - return u3nt - (c3y, - u3nt(u3_nul, - u3nc(u3_nul, u3k(axe)), - u3k(lon)), - u3nc(c3y, u3k(sut))); - } - else { - return u3nt - (c3n, c3y, u3qa_dec(p_heg)); - } - } - - static u3_noun - _find_buck_lose(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - return u3nt(c3n, c3y, u3k(p_heg)); - } - static u3_noun - _find_buck_stop(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - } - - static u3_noun - _find_buck_cell(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun exa = u3qc_peg(axe, 2); - u3_noun hed = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); - - u3z(exa); - if ( (u3_nul == hed) || (c3y == u3h(hed)) || (c3n == u3h(u3t(hed))) ) { - return hed; - } - else { - u3_noun exa = u3qc_peg(axe, 3); - u3_noun tal = _find_buck - (van, q_sut, way, u3t(u3t(hed)), q_heg, exa, lon, gil); - - u3z(exa); - u3z(hed); - - return tal; - } - } - } - } - - static u3_noun - _find_buck_core(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); - u3x_cell(rq_sut, &prq_sut, &qrq_sut); - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun zem = u3qf_loot(u3t(q_heg), qrq_sut); - - if ( (u3_nul != zem) && (0 != p_heg) ) { - u3_noun ped; - - ped = u3qa_dec(p_heg); - u3z(p_heg); p_heg = ped; - - u3z(zem); - zem = u3_nul; - } - - if ( u3_nul != zem ) { - u3_noun u_zem = u3t(zem); - u3_noun pu_zem = u3h(u_zem); - u3_noun qu_zem = u3t(u_zem); - u3_noun zut; - u3_noun pro; - -#if 1 - if ( qpq_sut == c3__wet ) { - zut = u3nc(c3__wet, u3k(qu_zem)); - } - else if ( qpq_sut == c3__dry ) { - zut = u3nc(c3__dry, u3k(qu_zem)); - } - else u3m_bail(c3__fail); -#endif - - pro = u3nt - (c3y, - u3nc(u3nc(u3_nul, u3k(axe)), u3k(lon)), - u3nt(c3n, - u3qc_peg(2, pu_zem), - u3nt(u3nc(u3k(sut), zut), u3_nul, u3_nul))); - - u3z(zem); - return pro; - } - else { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); - u3_noun pro; - - if ( c3n == u3h(pec) ) { - pro = _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else if ( c3y == u3t(pec) ) { - u3_noun exa = u3qc_peg(axe, 3); - - pro = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); - u3z(exa); - } - else { - u3_noun sam = u3qfu_peek(van, p_sut, way, 2); - u3_noun exa = u3qc_peg(axe, 6); - - pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil); - u3z(exa); - u3z(sam); - } - u3z(pec); - return pro; - } - } - } - } - - static u3_noun - _find_twin(u3_noun van, - u3_noun hax, - u3_noun yor) - { - if ( c3y == u3r_sing(hax, yor) ) { - return u3k(hax); - } - else if ( u3_nul == hax ) { - return u3k(yor); - } - else if ( u3_nul == yor ) { - return u3k(hax); - } - else if ( c3n == u3h(hax) ) { - if ( (c3n != u3h(yor)) ) { - return u3m_error("find-fork-a"); - } - else { - u3_noun p_hax = u3t(hax); // (each @ud {span nock}) - u3_noun p_yor = u3t(yor); // (each @ud {span nock}) - - if ( (c3n != u3h(p_hax)) || (c3n != u3h(p_yor)) ) { - return u3m_error("find-fork-b"); - } - else { - u3_noun pp_hax = u3t(p_hax); // {span nock} - u3_noun pp_yor = u3t(p_yor); // {span nock} - u3_noun ppp_hax = u3h(pp_hax); // span - u3_noun ppp_yor = u3h(pp_yor); // span - u3_noun qpp_hax = u3t(pp_hax); // nock - u3_noun qpp_yor = u3t(pp_yor); // nock - - if ( c3n == u3r_sing(qpp_hax, qpp_yor) ) { - return u3m_error("find-fork-c"); - } - return u3nt(c3n, - c3n, - u3nc( - u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), - u3k(qpp_hax))); - } - } - } - else { - if ( c3n == u3h(yor) ) { - return u3m_error("find-fork-d"); - } - else { - u3_noun p_hax = u3t(hax); // {vein opal} - u3_noun p_yor = u3t(yor); // {vein opal} - u3_noun pp_hax = u3h(p_hax); // vein - u3_noun pp_yor = u3h(p_yor); // vein - u3_noun qp_hax = u3t(p_hax); // opal - u3_noun qp_yor = u3t(p_yor); // opal - - if ( c3n == u3r_sing(pp_hax, pp_yor) ) { - return u3m_error("find-fork-e"); - } - else { - if ( c3y == u3h(qp_hax) ) { - if ( c3y != u3h(qp_yor) ) { - return u3m_error("find-fork-f"); - } else { - u3_noun pqp_hax = u3t(qp_hax); // type - u3_noun pqp_yor = u3t(qp_yor); // type - - return - u3nt(c3y, - u3k(pp_hax), - u3nc(c3y, u3kf_fork - (u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul)))); - } - } - else if ( c3n != u3h(qp_yor) ) { - return u3m_error("find-fork-g"); - } else { - u3_noun pqp_hax = u3h(u3t(qp_hax)); // axis - u3_noun pqp_yor = u3h(u3t(qp_yor)); // axis - u3_noun qqp_hax = u3t(u3t(qp_hax)); // (set {type foot}) - u3_noun qqp_yor = u3t(u3t(qp_yor)); // (set {type foot}) - - if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { - return u3m_error("find-fork-h"); - } else { - return - u3nt(c3y, - u3k(pp_hax), - u3nt(c3n, u3k(pqp_hax), u3qdi_uni(qqp_hax, qqp_yor))); - } - } - } - } - } - // error: { return u3m_error("find-fork"); } - } - - static u3_noun - _find_buck_fork_twin(u3_noun van, u3_noun wiz) - { - if ( u3_nul == wiz ) { - return u3_nul; - } - else if ( u3_nul == u3t(wiz) ) { - return u3k(u3h(wiz)); - } - else { - u3_noun hax = u3k(u3h(wiz)); - u3_noun yor = _find_buck_fork_twin(van, u3t(wiz)); - u3_noun fid = _find_twin(van, hax, yor); - - u3z(hax); - u3z(yor); - - return fid; - } - } - - static u3_noun - _find_buck_fork_turn(u3_noun van, - u3_noun yed, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == yed ) { - return u3_nul; - } - else { - u3_noun fid = _find_buck(van, u3h(yed), way, p_heg, q_heg, axe, lon, gil); - - return u3nc - (fid, - _find_buck_fork_turn - (van, u3t(yed), way, p_heg, q_heg, axe, lon, gil)); - } - } - - static u3_noun - _find_buck_fork(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut = u3t(sut); - u3_noun yed = u3qdi_tap(p_sut); - u3_noun wiz; - u3_noun ret; - - wiz = _find_buck_fork_turn(van, yed, way, p_heg, q_heg, axe, lon, gil); - u3z(yed); - - ret = _find_buck_fork_twin(van, wiz); - u3z(wiz); - - return ret; - } - - static u3_noun - _find_buck_face_next(u3_noun van, - u3_noun sut, - u3_noun q_sut, - u3_noun qp_sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == qp_sut ) { - u3_noun nol = u3nc(u3_nul, u3k(lon)); - u3_noun ret = _find_buck(van, q_sut, way, p_heg, q_heg, axe, nol, gil); - u3z(nol); - return ret; - } - else { - u3_noun iqp_sut = u3h(qp_sut); // twig - u3_noun tiv = u3qfu_mint // (pair type nock) - (van, q_sut, c3__noun, iqp_sut); - u3_noun tqp_sut = u3t(qp_sut); // (list twig) - u3_noun p_tiv = u3h(tiv); // type - u3_noun q_tiv = u3t(tiv); // nock - u3_noun fid = _find_buck // pony - (van, p_tiv, way, p_heg, q_heg, 1, u3_nul, u3_nul); - - if ( u3_nul == fid ) { - u3z(tiv); - return u3_nul; - } - else if ( (c3n == u3h(fid)) && (c3y == u3h(u3t(fid))) ) { - u3_noun ret; - - ret = _find_buck_face_next - (van, sut, q_sut, tqp_sut, way, u3t(u3t(fid)), q_heg, axe, lon, gil); - u3z(fid); - u3z(tiv); - return ret; - } - else { - u3_noun tor; // port - u3_noun vat; // (pair type nock) - u3_noun ret; - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun cob = u3qf_comb(dog, q_tiv); - - if ( c3y == u3h(fid) ) { - tor = u3nc(c3y, u3k(u3t(fid))); - } else { - tor = u3nc(c3n, u3k(u3t(u3t(fid)))); - } - u3z(fid); - - vat = u3qfu_fine(van, sut, tor); - u3z(tor); - - ret = u3nt - (c3n, - c3n, - u3nc(u3k(u3h(vat)), u3qf_comb(cob, u3t(vat)))); - - u3z(vat); - u3z(dog); - u3z(cob); - u3z(tiv); - - return ret; - } - } - } - - static u3_noun - _find_buck_face(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - - if ( u3_nul == q_heg ) { - return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun uq_heg = u3t(q_heg); // term - - if ( c3y == u3ud(p_sut) ) { - if ( c3y == u3r_sing(p_sut, uq_heg) ) { - return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - } - else { - u3_noun pp_sut = u3h(p_sut); // (map term {wain (unit twig)}) - u3_noun qp_sut = u3t(p_sut); // (list (pair type nock)) - u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit twig)) - - if ( u3_nul == tyr ) { - return _find_buck_face_next - (van, sut, q_sut, qp_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun u_tyr = u3t(tyr); // (unit twig) - - if ( u3_nul == u_tyr ) { - u3_noun nol = u3nc(u3_nul, u3k(lon)); - u3_noun dep = u3qa_inc(p_heg); - u3_noun ret = _find_buck - (van, q_sut, way, dep, q_heg, axe, nol, gil); - - u3z(dep); - u3z(nol); - u3z(tyr); - return ret; - } - else { - u3_noun uu_tyr = u3t(u_tyr); - u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); - - if ( c3y == u3h(tor) ) { - u3_noun p_tor = u3t(tor); // (pair vein opal) - u3_noun pp_tor = u3h(p_tor); // vein - u3_noun qp_tor = u3t(p_tor); // opal - u3_noun nol = // vein - u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon)); - u3_noun ret; - - ret = u3nt(c3y, u3qb_weld(pp_tor, nol), u3k(qp_tor)); - u3z(nol); - u3z(tor); - u3z(tyr); - return ret; - } - else { - u3_noun p_tor = u3t(tor); // (pair type nock) - u3_noun pp_tor = u3h(p_tor); // type - u3_noun qp_tor = u3t(p_tor); // nock - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun ret; - - ret = u3nt(c3n, - c3n, - u3nc(u3k(pp_tor), u3qf_comb(dog, qp_tor))); - u3z(dog); - u3z(tor); - u3z(tyr); - - return ret; - } - } - } - } - } - } - - static u3_noun - _find_buck(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - // u3l_log("noun\r\n"); - return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__void: { - // u3l_log("void\r\n"); - // return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - return u3_nul; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: - { - // u3l_log("atom\r\n"); - return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__cell: - { - // u3l_log("cell\r\n"); - return _find_buck_cell(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__core: - { - // u3l_log("core\r\n"); - return _find_buck_core(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__hint: - { - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, gil); - u3z(fop); - return pro; - } - case c3__face: - { - // u3l_log("face\r\n"); - return _find_buck_face(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__fork: - { - // u3l_log("fork\r\n"); - return _find_buck_fork(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__hold: - { - // u3l_log("hold\r\n"); - if ( (c3y == u3qdi_has(gil, sut)) ) { - return u3_nul; - } - else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - - static u3_noun - _find_limb(u3_noun van, - u3_noun sut, // type - u3_noun way, // ?(%read %rite %free %both) - u3_noun i_hyp, // limb - u3_noun p_mor) // palo - { - u3_noun pp_mor = u3h(p_mor); // vein - u3_noun qp_mor = u3t(p_mor); // opal - - { - u3_noun ref = u3qfu_felt(qp_mor); - u3_noun lon = u3k(pp_mor); - u3_noun heg = (c3y == u3du(i_hyp)) - ? u3k(i_hyp) - : u3nq(c3n, 0, u3_nul, u3k(i_hyp)); - u3_noun ret; - - if ( c3y == u3h(heg) ) { - u3_noun p_heg = u3t(heg); // axis - - if ( c3n == u3ud(p_heg) ) { - u3m_p("weird p_heg", p_heg); - return u3m_bail(c3__fail); - } - - ret = u3nt - (c3y, - u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); - } - else { - u3_noun p_heg = u3h(u3t(heg)); // @ud - u3_noun q_heg = u3t(u3t(heg)); // (unit term) - - ret = _find_buck - (van, ref, way, p_heg, q_heg, 1, lon, u3_nul); - } - u3z(heg); - u3z(lon); - u3z(ref); - - return ret; - } - } - - static u3_noun - _find_pony(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - if ( u3_nul == hyp ) { - return u3nt(c3y, u3_nul, u3nc(c3y, u3k(sut))); - } - else { - u3_noun i_hyp = u3h(hyp); - u3_noun t_hyp = u3t(hyp); - u3_noun mor = _find_pony(van, sut, way, t_hyp); - - if ( c3n == u3h(mor) ) { - u3_noun p_mor = u3t(mor); - - if ( c3y == u3h(p_mor) ) { - return mor; - } - else { - u3_noun pp_mor = u3t(p_mor); // {span nock} - u3_noun ppp_mor = u3h(pp_mor); // span - u3_noun qpp_mor = u3t(pp_mor); // nock - u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); - u3_noun fex = u3qfu_mint(van, ppp_mor, c3__noun, gen); - u3_noun ret = u3nt(c3n, - c3n, - u3nc(u3k(u3h(fex)), - u3qf_comb(qpp_mor, u3t(fex)))); - u3z(fex); - u3z(gen); - u3z(mor); - - return ret; - } - } - else { - u3_noun p_mor = u3t(mor); - u3_noun ret = _find_limb(van, sut, way, i_hyp, p_mor); - - u3z(mor); - return ret; - } - } - } - static u3_noun _cqfu_fond(u3_noun van, u3_noun sut, u3_noun way, u3_noun hyp) { - u3_noun taf; + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_fond-fond", von, "fond"); - taf = _find_pony(van, sut, way, hyp); + gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(hyp), 0); - return taf; + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } static u3_noun @@ -806,35 +23,12 @@ u3_noun way, u3_noun hyp) { - u3_noun taf = _find_pony(van, sut, way, hyp); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_find-find", von, "find"); - if ( u3_nul == taf ) { - goto error; - } - else { - if ( c3y == u3h(taf) ) { - u3_noun fat = u3nc(c3y, u3k(u3t(taf))); + gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(hyp), 0); - u3z(taf); - return fat; - } - else { - if ( c3n == u3h(u3t(taf)) ) { - u3_noun fat = u3nc(c3n, u3k(u3t(u3t(u3t(taf))))); - - u3z(taf); - return fat; - } - else { - goto error; - } - } - } - error: { - u3m_p("wing", hyp); - - return u3m_error("find"); - } + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -852,7 +46,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_find(van, sut, way, hyp); + return u3qfu_find(van, sut, way, hyp); } } @@ -890,7 +84,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_fond(van, sut, way, hyp); + return u3qfu_fond(van, sut, way, hyp); } } From 13c73ea9902528dddbe7155312f90624cfd1d52f Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 14:54:43 -0700 Subject: [PATCH 03/23] decapitate fire:ut --- pkg/urbit/jets/f/ut_fire.c | 168 ++----------------------------------- 1 file changed, 5 insertions(+), 163 deletions(-) diff --git a/pkg/urbit/jets/f/ut_fire.c b/pkg/urbit/jets/f/ut_fire.c index 3a7f06144a..bcc73a5e38 100644 --- a/pkg/urbit/jets/f/ut_fire.c +++ b/pkg/urbit/jets/f/ut_fire.c @@ -3,176 +3,18 @@ */ #include "all.h" - -/* logic -*/ - static u3_noun - _fire_vet(u3_noun van) - { - // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); - - switch ( vet ) { - case c3n: - case c3y: return vet; - default: return u3m_bail(c3__fail); - } - } - - static u3_noun - _fire_mull(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun gen) - { - u3_noun rib = u3r_at(u3qfu_van_rib, van); - u3_noun key = u3nt(u3k(sut), - u3k(dox), - u3k(gen)); - u3_noun ret; - - if ( c3n == _fire_vet(van) ) { - ret = c3y; - } - if ( c3y == u3qdi_has(rib, key) ) { - ret = c3y; - } - else { - u3_noun rob = u3qdi_put(rib, key); - u3_noun von = u3i_molt(u3k(van), - u3qfu_van_rib, - u3k(rob), - 0); - u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen); - - ret = c3y; - - u3z(mul); - u3z(von); - u3z(rob); - } - u3z(key); - return ret; - } - - static u3_noun - _fire_each(u3_noun van, - u3_noun vet, - u3_noun typ, - u3_noun gat) - { - u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; - u3_noun ppq_typ, qpq_typ, rpq_typ; - u3_noun h_gat, t_gat; - - if ( (c3n == u3du(typ)) || (c3__core != u3h(typ)) ) { - return u3m_error("fire-core"); - } else if - ( (c3n == u3r_cell(u3t(typ), &p_typ, &q_typ)) || - (c3n == u3r_trel(q_typ, &pq_typ, &qq_typ, &rq_typ)) || - (c3n == u3r_trel(pq_typ, &ppq_typ, &qpq_typ, &rpq_typ)) || - (c3n == u3r_cell(gat, &h_gat, &t_gat)) ) - { - return u3m_bail(c3__fail); - } else { - u3_noun dox = u3nt(c3__core, - u3k(qq_typ), - u3nt(u3nt(u3k(ppq_typ), u3k(qpq_typ), c3__gold), - u3k(qq_typ), - u3k(rq_typ))); - - if ( (c3__ash == u3h(gat)) || (c3__dry == u3h(gat)) ) { - if ( (c3y == vet) && - (c3n == u3qfu_nest(van, qq_typ, c3y, p_typ)) ) - { -#if 0 - u3_noun dun = u3qfu_dunq(van, "need", qq_typ); - u3_noun niz = u3qfu_dunq(van, "have", p_typ); - - u3t_push(u3nc(c3__mean, niz)); - u3t_push(u3nc(c3__mean, dun)); -#endif - return u3m_error("fire-dry"); - } - else { - return u3nc(dox, u3k(t_gat)); - } - } - else { - c3_assert(c3__wet == u3h(gat)); -#if 0 - u3_noun dun = u3qfu_dunq(van, "wild", typ); - u3_noun niz = u3qfu_dunq(van, "tame", dox); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -#endif - if ( (c3y == vet) && - (c3n == _fire_mull(van, typ, dox, t_gat)) ) - { - return u3m_error("fire-wet"); - } - else { - u3z(dox); -#if 0 - u3t_drop(); - u3t_drop(); -#endif - return u3nc(u3k(typ), u3k(t_gat)); - } - } - } - } - - static u3_noun - _fire_in(u3_noun van, - u3_noun vet, - u3_noun hag) - { - if ( u3_nul == hag ) { - return u3_nul; - } - else { - u3_noun i_hag = u3h(hag); - u3_noun t_hag = u3t(hag); - - if ( c3n == u3du(i_hag) ) { - return u3m_bail(c3__fail); - } else { - return u3nc - (_fire_each(van, vet, u3h(i_hag), u3t(i_hag)), - _fire_in(van, vet, t_hag)); - } - } - } - static u3_noun _cqfu_fire(u3_noun van, u3_noun sut, u3_noun hag) { - u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_fire-fire", von, "fire"); - c3_assert(!"not live"); - { - if ( (c3y == u3du(hag)) && (u3_nul == u3t(hag)) ) { - u3_noun i_hag = u3h(hag); - u3_noun pi_hag = u3h(i_hag); - u3_noun qi_hag = u3t(i_hag); + gat = u3i_molt(gat, u3x_sam, u3k(hag), 0); - if ( (c3__wet == u3h(qi_hag)) ) { - u3_noun qqi_hag = u3t(qi_hag); + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - if ( c3y == u3du(qqi_hag) && - (u3_nul == u3h(qqi_hag)) && - (1 == u3t(qqi_hag)) ) - { - return u3k(pi_hag); - } - } - } - } - return u3nc(c3__hold, _fire_in(van, vet, hag)); } /* boilerplate @@ -187,7 +29,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_fire(van, sut, hag); + return u3qfu_fire(van, sut, hag); } } From 61b957cc5b1d59e7933a7428c1ba0056ab8afa56 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:00:23 -0700 Subject: [PATCH 04/23] decapitate fish:ut --- pkg/urbit/jets/f/ut_fish.c | 142 +++---------------------------------- 1 file changed, 8 insertions(+), 134 deletions(-) diff --git a/pkg/urbit/jets/f/ut_fish.c b/pkg/urbit/jets/f/ut_fish.c index 409b80fe5a..cd14e00f64 100644 --- a/pkg/urbit/jets/f/ut_fish.c +++ b/pkg/urbit/jets/f/ut_fish.c @@ -3,144 +3,18 @@ */ #include "all.h" -/* functions -*/ - static u3_noun - _fish_in(u3_noun, u3_noun, u3_atom, u3_noun); - - static u3_noun - _fish_fork(u3_noun van, - u3_noun p_sut, - u3_atom axe, - u3_noun vit) - { - if ( u3_nul == p_sut ) { - return u3nc(1, 1); - } - else { - u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit); - u3_noun tal = _fish_fork(van, u3t(p_sut), axe, vit); - u3_noun pro = u3qf_flor(hed, tal); - - u3z(hed); - u3z(tal); - - return pro; - } - } - - static u3_noun - _fish_in(u3_noun van, - u3_noun sut, - u3_atom axe, - u3_noun vit) - { - u3_noun p_sut, q_sut; - - if ( c3y == u3ud(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return u3nc(1, 0); - } - case c3__void: { - return u3nc(1, 1); - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - if ( c3n == u3du(q_sut) ) { - u3_noun ton = u3nt(3, 0, u3k(axe)); - u3_noun pro = u3qf_flip(ton); - - u3z(ton); - return pro; - } else { - return u3nt(5, - u3nc(1, u3k(u3t(q_sut))), - u3nc(0, u3k(axe))); - } - } - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - u3_noun hut = u3nt(3, 0, u3k(axe)); - u3_noun lef = u3qc_peg(axe, 2); - u3_noun rit = u3qc_peg(axe, 3); - u3_noun hed = _fish_in(van, p_sut, lef, vit); - u3_noun tal = _fish_in(van, q_sut, rit, vit); - u3_noun hob = u3qf_flan(hed, tal); - u3_noun vug = u3qf_flan(hut, hob); - - u3z(hob); - u3z(tal); - u3z(hed); - u3z(rit); - u3z(lef); - u3z(hut); - - return vug; - } - } - case c3__core: { - return u3m_error("fish-core"); - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _fish_in(van, q_sut, axe, vit); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = _fish_fork(van, yed, axe, vit); - - u3z(yed); - return ret; - } - case c3__hold: { - p_sut = u3t(sut); - { - if ( (c3y == u3qdi_has(vit, sut)) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_shep - (van, "axis", 'd', u3k(axe)); - - // u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("fish-loop"); - } else { - u3_noun zoc = u3qdi_put(vit, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _fish_in(van, fop, axe, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - } - static u3_noun _cqfu_fish(u3_noun van, u3_noun sut, u3_atom axe) { - return _fish_in(van, sut, axe, u3_nul); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_fish-fish", von, "fish"); + + gat = u3i_molt(gat, u3x_sam, u3k(axe), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); + } @@ -157,7 +31,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_fish(van, sut, axe); + return u3qfu_fish(van, sut, axe); } } From ffa0d9108cee1a495bbee9ca8e6bd0c6997207de Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:03:35 -0700 Subject: [PATCH 05/23] decapitate fuse:ut --- pkg/urbit/jets/f/ut_fuse.c | 179 ++----------------------------------- 1 file changed, 8 insertions(+), 171 deletions(-) diff --git a/pkg/urbit/jets/f/ut_fuse.c b/pkg/urbit/jets/f/ut_fuse.c index dc1e356943..f148533caa 100644 --- a/pkg/urbit/jets/f/ut_fuse.c +++ b/pkg/urbit/jets/f/ut_fuse.c @@ -3,181 +3,18 @@ */ #include "all.h" -/* logic -*/ - static u3_noun - _fuse_in(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _fuse_repo(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun rep = u3qfu_repo(van, sut); - u3_noun ret = _fuse_in(van, rep, ref, bix); - - if ( c3y == u3r_sing(ret, rep) ) { - if ( c3__void == rep ) { - return c3__void; - } else { - u3z(rep); - u3z(ret); - return u3k(sut); - } - } else { - u3z(rep); - return ret; - } - } - - static u3_noun - _fuse_in_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_fuse_in(van, u3h(p_sut), ref, bix), - _fuse_in_fork(van, u3t(p_sut), ref, bix)); - } - } - - static u3_noun - _fuse_in(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_sut, q_sut; - - if ( c3y == u3r_sing(sut, ref) || (c3__noun == ref) ) { - return u3k(sut); - } - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: - { - return u3k(ref); - } - case c3__void: - { - return c3__void; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3y == u3du(ref) ) { - if ( c3__atom == u3h(ref) ) { - u3_noun p_ref, q_ref; - - u3x_cell(u3t(ref), &p_ref, &q_ref); - { - u3_noun foc = (c3y == u3qf_fitz(p_ref, p_sut)) - ? u3k(p_sut) - : u3k(p_ref); - - if ( c3y == u3du(q_sut) ) { - if ( c3y == u3du(q_ref) ) { - if ( c3y == u3r_sing(q_ref, q_sut) ) { - return u3nt(c3__atom, foc, u3k(q_sut)); - } - else { - u3z(foc); - return c3__void; - } - } - else { - return u3nt(c3__atom, foc, u3k(q_sut)); - } - } else { - return u3nt(c3__atom, foc, u3k(q_ref)); - } - } - } - else if ( c3__cell == u3h(ref) ) { - return c3__void; - } - } - return _fuse_in(van, ref, sut, bix); - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun p_ref, q_ref; - - if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { - u3_noun hed = _fuse_in(van, p_sut, p_ref, bix); - u3_noun tal = _fuse_in(van, q_sut, q_ref, bix); - u3_noun ret = u3qf_cell(hed, tal); - - u3z(hed); - u3z(tal); - return ret; - } - else return _fuse_in(van, ref, sut, bix); - } - case c3__core: - { - return _fuse_repo(van, sut, ref, bix); - } - case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun vot = _fuse_in(van, q_sut, ref, bix); - u3_noun ret = u3qf_hint(p_sut, vot); - - u3z(vot); - return ret; - } - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun vot = _fuse_in(van, q_sut, ref, bix); - u3_noun ret = u3qf_face(p_sut, vot); - - u3z(vot); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( c3y == u3qdi_has(bix, hud) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - // u3_noun niz = u3qfu_dunq(van, "over", ref); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("fuse-loop"); - } else { - u3_noun bux = u3qdi_put(bix, hud); - u3_noun ret = _fuse_repo(van, sut, ref, bux); - - u3z(hud); - u3z(bux); - return ret; - } - } - } - } - static u3_noun _cqfu_fuse(u3_noun van, u3_noun sut, u3_noun ref) { - return _fuse_in(van, sut, ref, u3_nul); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_fuse-fuse", von, "fuse"); + + gat = u3i_molt(gat, u3x_sam, u3k(ref), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); + } /* boilerplate @@ -192,7 +29,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_fuse(van, sut, ref); + return u3qfu_fuse(van, sut, ref); } } From 5057cb733cdd4ed471b97386335dd7bb89fbb2e0 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:09:20 -0700 Subject: [PATCH 06/23] decapitate mint:ut --- pkg/urbit/jets/f/ut_mint.c | 861 +------------------------------------ 1 file changed, 7 insertions(+), 854 deletions(-) diff --git a/pkg/urbit/jets/f/ut_mint.c b/pkg/urbit/jets/f/ut_mint.c index 6951b54c0b..9fbe30369c 100644 --- a/pkg/urbit/jets/f/ut_mint.c +++ b/pkg/urbit/jets/f/ut_mint.c @@ -3,865 +3,18 @@ */ #include "all.h" -/* logic -*/ - static u3_noun - _mint_in(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _mint_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _mint_tend(u3_noun vit) - { - if ( u3_nul == vit ) { - return 1; - } else { - u3_noun nex = _mint_tend(u3t(vit)); - - if ( u3_nul == u3h(vit) ) { - return nex; - } else { - u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); - - u3z(nex); - return boy; - } - } - } - - static u3_noun - _mint_vet(u3_noun van) - { - // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); - - switch ( vet ) { - case c3n: - case c3y: return vet; - default: return u3m_bail(c3__fail); - } - } - - static u3_noun - _mint_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - - static u3_noun - _mint_mine(u3_noun van, - u3_noun sut, - u3_noun mel, - u3_noun nym, - u3_noun hud, - u3_noun dom) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "mine"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(mel), - u3x_sam_6, - u3k(nym), - u3x_sam_14, - u3k(hud), - u3x_sam_15, - u3k(dom), - 0)); - } - - static u3_noun - _mint_burp(u3_noun van, - u3_noun sut) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - - return u3j_hook(von, "burp"); - } - - static u3_noun - _mint_cond(u3_noun pex, - u3_noun yom, - u3_noun woq) - { - if ( 1 == u3h(pex) ) { - if ( 0 == u3t(pex) ) { - u3z(pex); - u3z(woq); - - return yom; - } - else if ( 1 == u3t(pex) ) { - u3z(pex); - u3z(yom); - - return woq; - } - } - return u3nq(6, pex, yom, woq); - } - - static u3_noun - _mint_corn(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun mil = _mint_in(van, sut, c3__noun, gen); - u3_noun fol = u3k(u3t(mil)); - - u3z(mil); - return fol; - } - - static u3_noun - _mint_nice(u3_noun van, - u3_noun gol, - u3_noun typ) - { - if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, gol, c3y, typ)) ) - { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("mint-nice"); - } - else return typ; - } - - static u3_noun - _mint_cove(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 11 == u3h(nug) ) { - return _mint_cove(u3t(u3t(nug))); - } - else { - return u3m_error("mint-cove"); - } - } - - static u3_noun - _mint_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _mint_in(van, sut, c3__noun, ruf); - u3_noun p_dan = u3h(dan); - u3_noun q_dan = u3t(dan); - u3_noun pul = _mint_mine(van, p_dan, mel, nym, hud, dom); - u3_noun ret = u3nc(_mint_nice(van, gol, u3k(u3h(pul))), - u3qf_cons(u3t(pul), q_dan)); - - u3z(pul); - u3z(dan); - return ret; - } - - static u3_noun - _mint_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - -#if 1 - static u3_noun - _mint_cnts(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_6, - u3k(hyp), - u3x_sam_7, - u3k(rig), - 0)); - } -#else - static u3_noun - _mint_edit(u3_noun van, - u3_noun sut, - u3_noun mew, - u3_noun p_lar, - u3_noun rag, - u3_noun hej) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - u3_noun gim = u3qfu_fire(van, sut, rag); - u3_noun fol = u3qf_hike(p_lar, hej); - - u3z(rag); - u3z(hej); - - return u3nc(gim, fol); - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew); - u3_noun p_zil = u3h(zil); - u3_noun q_zil = u3t(zil); - u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag); - - u3z(rag); - rag = u3k(u3t(wip)); - - hej = u3nc(u3nc(u3k(u3h(wip)), - u3k(q_zil)), - hej); - - u3z(zil); - u3z(wip); - - mew = t_mew; - } - } - } - static u3_noun - _mint_cnts_old(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun p_lar = u3h(lar); - u3_noun q_lar = u3t(lar); - u3_noun pq_lar = u3h(q_lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun mew = rig; - u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul); - u3_noun p_yom = u3h(yom); - u3_noun q_yom = u3t(yom); - u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)), - (0 == pq_lar) ? u3k(q_yom) - : u3nt(9, u3k(pq_lar), u3k(q_yom))); - - u3z(yom); - u3z(lar); - - return ret; - } -#endif - -# define _mint_used() - - static u3_noun - _mint_in(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - u3_noun ret; - - if ( (c3__void == sut) && - !((c3y == u3du(gen)) && (c3__dbug == u3h(gen))) ) - { - if ( (c3n == _mint_vet(van)) - || ((c3y == u3du(gen)) && - ((c3__zpfs == u3h(gen)) || - (c3__zpsk == u3h(gen)) || - (c3__lost == u3h(gen)) || - (c3__fail == u3h(gen)) || - (c3__zpzp == u3h(gen)))) ) - { - return u3nt(c3__void, 0, 0); - } - else { - return u3m_error("mint-vain"); - } - } - - if ( c3n == u3du(gen) ) { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - ret = _mint_in(van, sut, gol, rex); - u3z(rex); - - return ret; - } - else if ( c3y == u3du(u3h(gen)) ) { - _mint_used(); - { - u3_noun hed = _mint_in(van, sut, c3__noun, u3h(gen)); - u3_noun tal = _mint_in(van, sut, c3__noun, u3t(gen)); - u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3qf_cons(u3t(hed), - u3t(tal))); - - u3z(hed); - u3z(tal); - - return ret; - } - } else switch ( u3h(gen) ) { - default: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("mint-open"); -#else - u3_err("h", u3h(gen)); - return u3m_bail(c3__fail); -#endif - } - ret = _mint_in(van, sut, gol, rex); - u3z(rex); - - return ret; - } - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun wam = u3qfu_play(van, sut, p_gen); - u3_noun dok = u3nc(c3__wing, u3k(q_gen)); - u3_noun vol = _mint_corn(van, sut, dok); - u3_noun axe = _mint_cove(vol); - - ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfu_fish(van, wam, axe)); - - u3z(axe); - u3z(vol); - u3z(wam); - u3z(dok); - - return ret; - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mint_used(); - { - u3_noun bol = _mint_bean(); - u3_noun nor = _mint_in(van, sut, bol, p_gen); - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); - u3_noun duy = (c3__void == fex) - ? ( (c3__void == wux) - ? u3nc(0, 0) - : u3nc(1, 1) ) - : ( (c3__void == wux) - ? u3nc(1, 0) - : u3k(u3t(nor)) ); - u3_noun hiq = _mint_in(van, fex, gol, q_gen); - u3_noun ran = _mint_in(van, wux, gol, r_gen); - - ret = u3nc(u3qf_forq(u3h(hiq), - u3h(ran)), - _mint_cond(duy, - u3k(u3t(hiq)), - u3k(u3t(ran)))); - - u3z(ran); - u3z(hiq); - u3z(nor); - u3z(wux); - u3z(fex); - u3z(bol); - - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hed = _mint_in(van, sut, c3__noun, p_gen); - u3_noun tal = _mint_in(van, sut, c3__noun, q_gen); - u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3qf_cons(u3t(hed), - u3t(tal))); - - u3z(hed); - u3z(tal); - - return ret; - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = _mint_nice(van, gol, _mint_bean()); - u3_noun one = _mint_in(van, sut, c3__noun, p_gen); - u3_noun two = _mint_in(van, sut, c3__noun, q_gen); - u3_noun ret; - - if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) && - (c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) ) - { - return u3m_error("nest"); - } - ret = u3nc(typ, u3nt(5, u3k(u3t(one)), u3k(u3t(two)))); - u3z(one); - u3z(two); - - return ret; - } - - case c3__dtwt: p_gen = u3t(gen); - _mint_used(); - { - u3_noun typ = _mint_nice(van, gol, _mint_bean()); - - return u3nc(typ, - u3nc(3, _mint_corn(van, sut, p_gen))); - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun nef = _mint_in(van, sut, gol, nog); - u3_noun viz = _mint_in(van, sut, c3__noun, q_gen); - - ret = u3nc(u3k(u3h(nef)), - u3nt(12, u3nc(1, u3nc(151, u3k(u3h(nef)))), u3k(u3t(viz)))); - - u3z(viz); - u3z(nef); - u3z(nog); - return ret; - } - - case c3__dtls: p_gen = u3t(gen); - _mint_used(); - { - u3_noun tom = u3nt(c3__atom, u3_blip, u3_nul); - u3_noun sam = _mint_in(van, sut, tom, p_gen); - - ret = u3nc(_mint_nice(van, gol, tom), - u3nc(4, u3k(u3t(sam)))); - - u3z(sam); - return ret; - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - u3_noun ret = u3nc(_mint_nice(van, gol, typ), - u3nc(1, u3k(q_gen))); - - return ret; - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun one = _mint_corn(van, sut, p_gen); - u3_noun two = _mint_corn(van, sut, q_gen); - - return u3nc(_mint_nice(van, gol, c3__noun), - u3nt(2, one, two)); - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - u3_noun ret = u3nc(_mint_nice(van, gol, typ), - u3nc(1, u3k(q_gen))); - - return ret; - } - - case c3__hand: - _mint_used(); - { - return u3k(u3t(gen)); - } - - case c3__ktbr: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__iron); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__ktpd: - case c3__ktpm: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__zinc); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__lead); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun hum = _mint_in(van, sut, gol, q_gen); - - u3_noun ret = u3nc(u3qf_hint(hit, u3h(hum)), - u3k(u3t(hum))); - u3z(hum); - u3z(hit); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mint_used(); - { - return u3nc(u3qf_face(p_gen, sut), u3nc(0, 1)); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun huz = u3qfu_play(van, sut, p_gen); - u3_noun hif = _mint_nice(van, gol, huz); - u3_noun zel = _mint_in(van, sut, hif, q_gen); - u3_noun ret = u3nc(hif, u3k(u3t(zel))); - - u3z(zel); - return ret; - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun fid = _mint_in(van, sut, c3__noun, p_gen); - u3_noun p_fid = u3h(fid); - u3_noun q_fid = u3t(fid); - - if ( 0 == p_fid ) { - u3m_p("bad subject: p_gen", p_gen); - c3_assert(0); - } - u3_noun dov = _mint_in(van, p_fid, gol, q_gen); - u3_noun p_dov = u3h(dov); - u3_noun q_dov = u3t(dov); - - ret = u3nc(u3k(p_dov), - u3qf_comb(q_fid, q_dov)); - - u3z(fid); - u3z(dov); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun ret = _mint_in(van, boc, gol, q_gen); - - u3z(boc); - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - return _mint_cnts(van, sut, gol, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__dry, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__wet, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _mint_in(van, sut, gol, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hum = _mint_in(van, sut, gol, q_gen); - u3_noun bez; - - if ( c3y == u3ud(p_gen) ) { - bez = u3k(p_gen); - } else { - bez = u3nc(u3k(u3h(p_gen)), - _mint_corn(van, sut, u3t(p_gen))); - } - ret = u3nc(u3k(u3h(hum)), - u3nt(11, bez, u3k(u3t(hum)))); - - u3z(hum); - return ret; - } - - case c3__zpts: p_gen = u3t(gen); - _mint_used(); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun sev = _mint_corn(von, sut, p_gen); - - u3z(von); - return u3nc(c3__noun, u3nc(1, sev)); - } - - case c3__ktcn: p_gen = u3t(gen); - _mint_used(); - { - 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; - } - - case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); - - if ( c3y != u3h(fid) ) { - return u3m_error("mint-fragment"); - } - else { - u3_noun pp_fid = u3h(u3t(fid)); - u3_noun qp_fid = u3t(u3t(fid)); - - if ( c3y != u3h(qp_fid) ) { - return u3m_error("mint-fragment"); - } - else { - u3_noun pqp_fid = u3t(qp_fid); - u3_noun axe = _mint_tend(pp_fid); - u3_noun ret; - - ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfr_fish(van, pqp_fid, p_gen, axe)); - - u3z(axe); - u3z(fid); - u3z(hyp); - - return ret; - } - } - } - - case c3__cold: - case c3__ktsg: p_gen = u3t(gen); - _mint_used(); - { - - c3_m fun_m = 141 + c3__blow; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen); - - if ( u3_none != pro ) { - return pro; - } - else { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_in-blow", 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 u3z_save_4(fun_m, vrf, sut, gol, p_gen, pro); - } - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - return u3nc(_mint_nice(van, - gol, - u3qfu_play(van, sut, p_gen)), - u3nc(1, u3k(q_gen))); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3t_push(u3nc(c3__mean, _mint_loc(van, p_gen))); - { - u3_noun hum = _mint_in(van, sut, gol, q_gen); - u3_noun bez = u3nt(c3__spot, 1, u3k(p_gen)); - - ret = u3nc(u3k(u3h(hum)), u3nt(11, bez, u3k(u3t(hum)))); - u3z(hum); - } - u3t_drop(); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); - u3_noun zur = u3qfu_play(van, sut, p_gen); - u3_noun p_vos = u3h(vos); - u3_noun q_vos = u3t(vos); - u3_noun waz = u3nc(1, _mint_burp(van, p_vos)); - // u3_noun waz = u3nc(1, u3k(p_vos)); - u3_noun sif = u3k(zur); - u3_noun cig = u3qf_cell(sif, p_vos); - u3_noun ret; - - ret = u3nc(_mint_nice(van, gol, cig), - u3qf_cons(waz, q_vos)); - - u3z(waz); - u3z(zur); - u3z(sif); - u3z(vos); - - return ret; - } - - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mint_used(); - { - if ( c3y == _mint_feel(van, sut, p_gen) ) { - return _mint_in(van, sut, gol, q_gen); - } else { - return _mint_in(van, sut, gol, r_gen); - } - } - - case c3__lost: p_gen = u3t(gen); - _mint_used(); - { - if ( c3y == _mint_vet(van) ) { - u3_noun zur = u3qfu_play(van, sut, p_gen); - u3_noun dun = u3qfu_dunq(van, "lost", zur); - - u3t_push(u3nc(c3__mean, dun)); - return u3m_error("mint-lost"); - } - else { - return u3nt(c3__void, 0, 0); - } - } - - case c3__fail: - case c3__zpzp: - _mint_used(); - { - return u3nt(c3__void, 0, 0); - } - } - } - static u3_noun _cqfu_mint(u3_noun van, u3_noun sut, u3_noun gol, u3_noun gen) { - return _mint_in(van, sut, gol, gen); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_mint-mint", von, "mint"); + + gat = u3i_molt(gat, u3x_sam_2, u3k(gol), u3x_sam_3, u3k(gen), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -879,7 +32,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_mint(van, sut, gol, gen); + return u3qfu_mint(van, sut, gol, gen); } } From 7306e80da2a55da98965cdb2a9b580d2438ce017 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:16:19 -0700 Subject: [PATCH 07/23] decapitate mull:ut --- pkg/urbit/jets/f/ut_mull.c | 811 +------------------------------------ 1 file changed, 11 insertions(+), 800 deletions(-) diff --git a/pkg/urbit/jets/f/ut_mull.c b/pkg/urbit/jets/f/ut_mull.c index abd4859a95..900014aac8 100644 --- a/pkg/urbit/jets/f/ut_mull.c +++ b/pkg/urbit/jets/f/ut_mull.c @@ -3,803 +3,6 @@ */ #include "all.h" -/* functions -*/ - static u3_noun - _mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _mull_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _mull_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - - static u3_noun - _mull_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - - static u3_noun - _mull_tend(u3_noun vit) - { - if ( u3_nul == vit ) { - return 1; - } else { - u3_noun nex = _mull_tend(u3t(vit)); - - if ( u3_nul == u3h(vit) ) { - return nex; - } else { - u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); - - u3z(nex); - return boy; - } - } - } - static u3_noun - _mull_cove(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 11 == u3h(nug) ) { - return _mull_cove(u3t(u3t(nug))); - } - else { - return u3m_error("mull-cove"); - } - } - - static u3_noun - _mull_mile(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun mel, - u3_noun nym, - u3_noun hud, - u3_noun dom) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "mile"); - - // u3l_log("mile\r\n"); - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(dox), - u3x_sam_6, - u3k(mel), - u3x_sam_14, - u3k(nym), - u3x_sam_30, - u3k(hud), - u3x_sam_31, - u3k(dom), - 0)); - } - - static u3_noun - _mull_doke(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun fug = u3qfu_mint(van, sut, c3__noun, gen); - u3_noun axe = _mull_cove(u3t(fug)); - - u3z(fug); - return axe; - } - - static u3_noun - _mull_nice(u3_noun van, - u3_noun gol, - u3_noun typ) - { - if ( c3n == u3qfu_nest(van, gol, c3y, typ) ) { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("mull-nice"); - } - else return typ; - } - - static u3_noun - _mull_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _mull_in(van, sut, c3__noun, dox, ruf); - u3_noun p_dan = u3h(dan); - u3_noun q_dan = u3t(dan); - u3_noun yaz = _mull_mile(van, p_dan, q_dan, mel, nym, hud, dom); - u3_noun p_yaz = u3h(yaz); - u3_noun q_yaz = u3t(yaz); - u3_noun ret = u3nc(_mull_nice(van, gol, u3k(p_yaz)), u3k(q_yaz)); - - u3z(yaz); - u3z(dan); - - return ret; - } - - static u3_noun - _mull_both(u3_noun van, - u3_noun gol, - u3_noun typ) - { - return u3nc(_mull_nice(van, gol, u3k(typ)), - typ); - } - -#if 1 - static u3_noun - _mull_cnts(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_6, - u3k(dox), - u3x_sam_14, - u3k(hyp), - u3x_sam_15, - u3k(rig), - 0)); - } -#else - static u3_noun - _mull_edit(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun mew, - u3_noun p_yom, - u3_noun q_yom) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - return u3nc(p_yom, q_yom); - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); - u3_noun p_zil = u3h(zil); - u3_noun q_zil = u3t(zil); - u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom); - u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom); - - if ( u3r_sing(u3h(cuf), u3h(dof)) ) { - u3m_error("mull-bonk-a"); - } - - u3z(p_yom); - p_yom = u3k(u3t(cuf)); - - u3z(q_yom); - q_yom = u3k(u3t(dof)); - - u3z(dof); - u3z(cuf); - u3z(zil); - - mew = t_mew; - } - } - } - - static u3_noun - _mull_cnts_old(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp); - u3_noun p_lar = u3h(lar); - u3_noun q_lar = u3t(lar); - u3_noun pq_lar = u3h(q_lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun p_vug = u3h(vug); - u3_noun q_vug = u3t(vug); - u3_noun pq_vug = u3h(q_vug); - u3_noun qq_vug = u3t(q_vug); - - if ( c3a(u3r_sing(p_lar, p_vug), u3r_sing(pq_lar, pq_vug)) ) { - u3m_error("mull-bonk-e"); - } - { - u3_noun mew = rig; - u3_noun yom = _mull_edit - (van, sut, dox, mew, u3k(qq_lar), - u3k(qq_vug)); - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom)); - u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom)); - - u3z(von); - u3z(yom); - u3z(vug); - u3z(lar); - - return u3nc(_mull_nice(van, gol, p_ret), q_ret); - } - } -#endif - -# define _mull_used() - - static u3_noun - _mull_in(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - u3_noun ret; - - if ( c3n == u3du(gen) ) { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - ret = _mull_in(van, sut, gol, dox, rex); - u3z(rex); - - return ret; - } - else if ( c3y == u3du(u3h(gen)) ) { - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, u3h(gen)); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, u3t(gen)); - u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); - u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(tal); - u3z(hed); - - return ret; - } - } - else switch ( u3h(gen) ) { - default: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("mull-open"); -#else - u3_err("h", u3h(gen)); - return u3m_bail(c3__fail); -#endif - } - ret = _mull_in(van, sut, gol, dox, rex); - u3z(rex); - - return ret; - } - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_waz = u3qfu_play(van, sut, p_gen); - u3_noun q_waz = u3qfu_play(van, dox, p_gen); - u3_noun dok = u3nc(c3__wing, u3k(q_gen)); - u3_noun p_syx = _mull_doke(van, sut, dok); - u3_noun q_syx = _mull_doke(van, dox, dok); - u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); - u3_noun q_pov = u3qfu_fish(van, q_waz, q_syx); - - if ( (c3n == u3r_sing(p_syx, q_syx)) || - (c3n == u3r_sing(p_pov, q_pov)) ) - { - return u3m_error("mull-bonk-b"); - } - u3z(p_waz); u3z(q_waz); - u3z(p_syx); u3z(q_syx); - u3z(p_pov); u3z(q_pov); - u3z(dok); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); - u3_noun gax = u3qfu_find(van, dox, c3__free, hyp); - u3_noun old_type, old_axis; - u3_noun new_type, new_axis; - - { - if ( c3y != u3h(fid) ) { - return u3m_error("mull-bonk-x"); - } - else { - u3_noun pp_fid = u3h(u3t(fid)); - u3_noun qp_fid = u3t(u3t(fid)); - - if ( c3y != u3h(qp_fid) ) { - return u3m_error("mull-bonk-x"); - } - new_type = u3t(qp_fid); - new_axis = _mull_tend(pp_fid); - } - } - - { - if ( c3y != u3h(gax) ) { - return u3m_error("mull-bonk-x"); - } - else { - u3_noun pp_gax = u3h(u3t(gax)); - u3_noun qp_gax = u3t(u3t(gax)); - - if ( c3y != u3h(qp_gax) ) { - return u3m_error("mull-bonk-x"); - } - old_type = u3t(qp_gax); - old_axis = _mull_tend(pp_gax); - } - } - if ( c3n == u3r_sing(old_axis, new_axis) ) { - return u3m_error("mull-bonk-x"); - } - else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) { - return u3m_error("mull-bonk-x"); - } - - u3z(old_axis); - u3z(new_axis); - u3z(gax); - u3z(fid); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mull_used(); - { - u3_noun bol = _mull_bean(); - u3_noun nor = _mull_in(van, sut, bol, dox, p_gen); - u3_noun p_fex = u3qfu_gain(van, sut, p_gen); - u3_noun q_fex = u3qfu_gain(van, dox, p_gen); - u3_noun p_wux = u3qfu_lose(van, sut, p_gen); - u3_noun q_wux = u3qfu_lose(van, dox, p_gen); - u3_noun hiq, ran; - u3_noun dis, dat; - u3_noun ret; - - if ( c3__void == p_fex ) { - hiq = u3nc(c3__void, - (c3__void == q_fex) - ? c3__void - : u3qfu_play(van, q_fex, q_gen)); - } else if ( c3__void == q_fex ) { - hiq = u3m_error("mull-bonk-c"); - } - else hiq = _mull_in(van, p_fex, gol, q_fex, q_gen); - - if ( c3__void == p_wux ) { - ran = u3nc(c3__void, - (c3__void == q_wux) - ? c3__void - : u3qfu_play(van, q_wux, r_gen)); - } else if ( c3__void == q_wux ) { - ran = u3m_error("mull-bonk-d"); - } - else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); - - dis = u3qf_forq(u3h(hiq), u3h(ran)); - dat = u3qf_forq(u3t(hiq), u3t(ran)); - - ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(ran); - u3z(hiq); - u3z(q_wux); - u3z(p_wux); - u3z(q_fex); - u3z(p_fex); - u3z(nor); - u3z(bol); - - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); - u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(tal); - u3z(hed); - - return ret; - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - - u3z(hed); - u3z(tal); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__dtwt: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen); - - u3z(vay); - return _mull_both(van, gol, _mull_bean()); - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun vay = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun ret; - - u3z(vay); - ret = _mull_in(van, sut, gol, dox, nog); - u3z(nog); - return ret; - } - - case c3__dtls: p_gen = u3t(gen); - _mull_used(); - { - u3_noun wuq = u3nt(c3__atom, u3_blip, u3_nul); - u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen); - - u3z(vay); - return _mull_both(van, gol, wuq); - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - - return _mull_both(van, gol, typ); - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - - u3z(hed); - u3z(tal); - - return _mull_both(van, gol, c3__noun); - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - return _mull_both(van, gol, typ); - } - - case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return u3nc(u3k(p_gen), u3k(p_gen)); - } - - case c3__ktbr: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__iron), - u3qfu_wrap(van, - u3t(vat), - c3__iron)); - - u3z(vat); - return pro; - } - - case c3__ktpd: - case c3__ktpm: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__zinc), - u3qfu_wrap(van, - u3t(vat), - c3__zinc)); - - u3z(vat); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__lead), - u3qfu_wrap(van, - u3t(vat), - c3__lead)); - - u3z(vat); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun hix = u3nc(u3k(dox), u3k(p_gen)); - u3_noun ret = u3nc(u3qf_hint(hit, u3h(vat)), - u3qf_hint(hix, u3t(vat))); - - u3z(hix); - u3z(hit); - u3z(vat); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mull_used(); - { - return u3nc(u3qf_face(p_gen, sut), - u3qf_face(p_gen, dox)); - } - - case c3__ktsg: p_gen = u3t(gen); - _mull_used(); - { - return _mull_in(van, sut, gol, dox, p_gen); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); - u3_noun q_hif = u3qfu_play(van, dox, p_gen); - u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); - u3_noun ret = u3nc(p_hif, q_hif); - - u3z(zel); - return ret; - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun p_lem = u3h(lem); - u3_noun q_lem = u3t(lem); - u3_noun ret = _mull_in(van, p_lem, gol, q_lem, q_gen); - - u3z(lem); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun nuf = u3qfu_busk(van, dox, p_gen); - u3_noun ret = _mull_in(van, boc, gol, nuf, q_gen); - - u3z(boc); - u3z(nuf); - - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return _mull_cnts(van, sut, gol, dox, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mull_grow - (van, sut, gol, dox, c3__gold, p_gen, c3__dry, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mull_grow - (van, sut, gol, dox, c3__gold, p_gen, c3__wet, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - u3_noun ret; - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _mull_in(van, sut, gol, dox, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return _mull_in(van, sut, gol, dox, q_gen); - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_ret = u3qfu_play(van, sut, p_gen); - u3_noun q_ret = u3qfu_play(van, sut, q_gen); - - return u3nc(_mull_nice(van, gol, p_ret), - q_ret); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3_noun ret; - - u3t_push(u3nc(c3__mean, _mull_loc(van, p_gen))); - { - ret = _mull_in(van, sut, gol, dox, q_gen); - } - u3t_drop(); - return ret; - } - - case c3__zpts: p_gen = u3t(gen); - _mull_used(); - { - return _mull_both(van, gol, c3__noun); - } - - case c3__ktcn: p_gen = u3t(gen); - _mull_used(); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); - - u3z(von); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_zur = u3qfu_play(van, sut, p_gen); - u3_noun q_zur = u3qfu_play (van, dox, p_gen); - u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun p_ret = u3qf_cell(p_zur, u3h(vos)); - u3_noun q_ret = u3qf_cell(q_zur, u3t(vos)); - - u3z(vos); - u3z(q_zur); - u3z(p_zur); - - return u3nc - (_mull_nice(van, gol, p_ret), q_ret); - } - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mull_used(); - { - c3_o fes = _mull_feel(van, sut, p_gen); - c3_o fed = _mull_feel(van, dox, p_gen); - - if ( fes != fed ) { - return u3m_error("mull-bonk-f"); - } - else { - if ( c3y == fes ) { - return _mull_in(van, sut, gol, dox, q_gen); - } else { - return _mull_in(van, sut, gol, dox, r_gen); - } - } - } - - case c3__lost: - case c3__fail: - case c3__zpzp: - _mull_used(); - { - return u3nc(c3__void, c3__void); - } - } - } - static u3_noun _cqfu_mull(u3_noun van, u3_noun sut, @@ -807,8 +10,16 @@ u3_noun dox, u3_noun gen) { - return _mull_in(van, sut, gol, dox, gen); - } + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_mull-mull", von, "mull"); + + gat = u3i_molt(gat, + u3x_sam_2, u3k(gol), + u3x_sam_6, u3k(dox), + u3x_sam_7, u3k(gen), + 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate */ @@ -826,7 +37,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_mull(van, sut, gol, dox, gen); + return u3qfu_mull(van, sut, gol, dox, gen); } } From 6fdb739a38e96aed866d168c7413c0d7182d2699 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:25:26 -0700 Subject: [PATCH 08/23] decapitate peek:ut --- pkg/urbit/jets/f/ut_peek.c | 189 ++----------------------------------- 1 file changed, 7 insertions(+), 182 deletions(-) diff --git a/pkg/urbit/jets/f/ut_peek.c b/pkg/urbit/jets/f/ut_peek.c index 4db024feba..efdcb89f0d 100644 --- a/pkg/urbit/jets/f/ut_peek.c +++ b/pkg/urbit/jets/f/ut_peek.c @@ -3,193 +3,18 @@ */ #include "all.h" - -/* logic -*/ - static u3_noun - _cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom); - - static u3_noun - _peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); - - static u3_noun - _peek_fork(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil), - _peek_fork(van, u3t(p_sut), way, axe, gil)); - } - } - - static u3_noun - _peek_in(u3_noun van, - u3_noun sut, - u3_noun way, - u3_atom axe, - u3_noun gil) - { - u3_noun p_sut, q_sut; - u3_noun pro; - - if ( (c3n == u3du(sut)) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return c3__noun; - } - case c3__void: { - return c3__void; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - return c3__void; - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - u3_atom tip = u3qc_cap(axe); - u3_atom tap = u3qc_mas(axe); - - if ( 2 == tip ) { - pro = _cqfu_peek(van, p_sut, way, tap); - } - else { - pro = _cqfu_peek(van, q_sut, way, tap); - } - u3z(tap); - u3z(tip); - - return pro; - } - } - case c3__core: { - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - u3_noun prq_sut, qrq_sut; - - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) || - (c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut)) || - (c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut)) || - (c3n == u3r_cell(rq_sut, &prq_sut, &qrq_sut)) ) - { - return u3m_bail(c3__fail); - } else { - u3_atom now = u3qc_cap(axe); - u3_atom lat = u3qc_mas(axe); - - if ( 3 == now ) { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); - u3_noun sam = u3h(pec); - u3_noun con = u3t(pec); - u3_atom tow; - - if ( 1 == lat ) { - tow = 1; - } else { - tow = u3qc_cap(lat); - } - - if ( (c3y == c3a(sam, con)) || - ((c3y == sam) && (tow == 2)) || - ((c3y == con) && (tow == 3)) ) - { - pro = _cqfu_peek(van, p_sut, way, lat); - } - else { - - if ( way != c3__read ) { - return u3m_error("payload-block"); - } - - u3_noun typ; - - { - u3_noun hed, tal; - - if ( c3n == sam ) { - hed = c3__noun; - } else { - hed = _cqfu_peek(van, p_sut, way, 2); - } - - if ( c3n == con ) { - tal = c3__noun; - } else { - tal = _cqfu_peek(van, p_sut, way, 3); - } - - typ = u3qf_cell(hed, tal); - u3z(hed); - u3z(tal); - } - - pro = _cqfu_peek(van, typ, way, lat); - u3z(typ); - } - - u3z(pec); - u3z(tow); - } - else { - pro = c3__noun; - } - u3z(lat); - u3z(now); - - return pro; - } - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _peek_in(van, q_sut, way, axe, gil); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); - - u3z(yed); - return ret; - } - case c3__hold: { - if ( (c3y == u3qdi_has(gil, sut)) ) { - return c3__void; - } - else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _peek_in(van, fop, way, axe, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - static u3_noun _cqfu_peek(u3_noun van, u3_noun sut, u3_noun way, u3_atom axe) { - if ( 1 == axe ) { - return u3k(sut); - } - else return _peek_in(van, sut, way, axe, u3_nul); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_peek-peek", von, "peek"); + + gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(axe), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -208,7 +33,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_peek(van, sut, way, axe); + return u3qfu_peek(van, sut, way, axe); } } From 70b0223d39dade63f68f9f59cef62428aa3c00f0 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:39:31 -0700 Subject: [PATCH 09/23] decapitate peel:ut --- pkg/urbit/jets/f/ut_peel.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/pkg/urbit/jets/f/ut_peel.c b/pkg/urbit/jets/f/ut_peel.c index 717a625433..b3d3e21227 100644 --- a/pkg/urbit/jets/f/ut_peel.c +++ b/pkg/urbit/jets/f/ut_peel.c @@ -3,26 +3,18 @@ */ #include "all.h" - -/* logic -*/ u3_noun _cqfu_peel(u3_noun van, u3_noun sut, u3_noun way, - u3_noun met) + u3_noun axe) { - if ( c3__gold == met ) { - return u3nc(c3y, c3y); - } - else switch ( way ) { - default: return u3m_bail(c3__fail); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_peel-peel", von, "peel"); - case c3__both: return u3nc(c3n, c3n); - case c3__free: return u3nc(c3y, c3y); - case c3__read: return u3nc(((met == c3__zinc) ? c3y : c3n), c3n); - case c3__rite: return u3nc(((met == c3__iron) ? c3y : c3n), c3n); - } + gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(axe), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -30,17 +22,17 @@ u3_noun u3wfu_peel(u3_noun cor) { - u3_noun sut, way, met, van; + u3_noun sut, way, axe, van; if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &met, + u3x_sam_3, &axe, u3x_con, &van, 0)) || (u3_none == (sut = u3r_at(u3x_sam, van))) ) { return u3m_bail(c3__fail); } else { - return _cqfu_peel(van, sut, way, met); + return u3qfu_peel(van, sut, way, axe); } } @@ -48,8 +40,8 @@ u3qfu_peel(u3_noun van, u3_noun sut, u3_noun way, - u3_noun met) + u3_noun axe) { - return _cqfu_peel(van, sut, way, met); + return _cqfu_peel(van, sut, way, axe); } From 1005d5d7f88d88ee0eb50ae465a487eb854e4f20 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 15:48:09 -0700 Subject: [PATCH 10/23] decapitate play:ut (broken??) --- pkg/urbit/jets/f/ut_play.c | 562 +------------------------------------ 1 file changed, 6 insertions(+), 556 deletions(-) diff --git a/pkg/urbit/jets/f/ut_play.c b/pkg/urbit/jets/f/ut_play.c index bdd13755af..899135263f 100644 --- a/pkg/urbit/jets/f/ut_play.c +++ b/pkg/urbit/jets/f/ut_play.c @@ -3,567 +3,17 @@ */ #include "all.h" -/* logic -*/ -# define _play_used() - - static u3_noun - _play_in(u3_noun, u3_noun, u3_noun); - - static u3_noun - _play_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _play_rock(u3_noun odo, u3_noun bob) - { - if ( c3y == u3ud(bob) ) { - return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob)); - } - else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), - _play_rock(odo, u3t(bob))); - } - - static u3_noun - _play_sand(u3_noun odo, u3_noun bob) - { - if ( c3y == u3ud(bob) ) { - if ( 'n' == odo ) { - if ( (bob != 0) ) { - return u3m_bail(c3__exit); - } else { - return u3nq(c3__atom, odo, u3_nul, bob); - } - } - if ( 'f' == odo ) { - if ( (bob > 1) ) { - return u3m_bail(c3__exit); - } else { - return _play_bean(); - } - } - return u3nt(c3__atom, u3k(odo), u3_nul); - } - else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), - _play_rock(odo, u3t(bob))); - } - - static u3_noun - _play_core(u3_noun pac, - u3_noun con) - { - if ( (c3__void == pac) ) { - u3z(con); - - return c3__void; - } else { - return u3nt(c3__core, pac, con); - } - } - - static u3_noun - _play_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - - static u3_noun - _play_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - -#if 0 - static u3_noun - _play_loc_term(u3_noun van, - u3_noun loc) - { - u3_noun fop = u3kb_flop(u3k(u3h(loc))); - u3_noun nam = ((0 == fop) ? c3__none : u3k(u3h(fop))); - u3_noun lys = u3nt(u3k(u3h(u3t(loc))), u3k(u3t(u3t(loc))), u3_nul); - u3_noun rup = u3nc(nam, lys); - c3_c* pre_c = u3m_pretty(rup); - u3_noun pro = u3i_string(pre_c); - - u3z(fop); - u3z(rup); - free(pre_c); - - return pro; - } -#endif - -#if 1 - static u3_noun - _play_cnts(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(hyp), - u3x_sam_3, - u3k(rig), - 0)); - } -#else - static u3_noun - _play_edit(u3_noun van, - u3_noun sut, - u3_noun mew, - u3_noun rag) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - return rag; - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun laf = _play_in(van, sut, qi_mew); - u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag); - - u3z(laf); - u3z(rag); - rag = u3k(u3t(ruz)); - u3z(ruz); - - mew = t_mew; - } - } - } - static u3_noun - _play_cnts_old(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun q_lar = u3t(lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun mew = rig; - u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar)); - u3_noun ret = u3qfu_fire(van, sut, rag); - - u3z(rag); - u3z(lar); - - return ret; - } -#endif - - static u3_noun - _play_grow(u3_noun van, - u3_noun sut, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _play_in(van, sut, ruf); - - return _play_core(dan, - u3nt(u3nt(u3k(nym), u3k(hud), u3k(mel)), - u3k(dan), - u3nc(u3nc(u3nc(c3__full, u3_nul), u3_nul), - u3k(dom)))); - } - - static u3_noun - _play_in(u3_noun van, - u3_noun sut, - u3_noun gen); - - static u3_noun - _play_x(u3_noun van, - u3_noun sut, - u3_noun gen) - { -#if 1 - return _play_in(van, sut, gen); -#else - u3_noun zix = u3qfu_shep - (van, "gene", 'q', u3k(gen)); - u3_noun ret; - - u3t_push(u3nc(c3__mean, zix)); - - ret = _play_in(van, sut, gen); - - u3t_drop(); - return ret; -#endif - } - - static u3_noun - _play_in(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - - if ( c3n == u3du(gen) ) { - open: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - u3_noun ret; - - if ( c3y == u3r_sing(rex, gen) ) { - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("play-open-z"); - } - ret = _play_x(van, sut, rex); - u3z(rex); - - return ret; - } - } - else if ( c3y == u3du(u3h(gen)) ) { - _play_used(); - { - u3_noun dis = _play_x(van, sut, u3h(gen)); - u3_noun dat = _play_x(van, sut, u3t(gen)); - u3_noun ret = u3qf_cell(dis, dat); - - u3z(dis); - u3z(dat); - return ret; - } - } - else switch ( u3h(gen) ) { - default: goto open; - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_bean(); - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _play_used(); - { - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); - u3_noun dez = (fex == c3__void) ? c3__void - : _play_x(van, fex, q_gen); - u3_noun doz = (wux == c3__void) ? c3__void - : _play_x(van, wux, r_gen); - u3_noun ret = u3qf_forq(dez, doz); - - u3z(dez); u3z(doz); - u3z(fex); u3z(wux); - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun dis = _play_x(van, sut, p_gen); - u3_noun dat = _play_x(van, sut, q_gen); - u3_noun ret = u3qf_cell(dis, dat); - - u3z(dis); - u3z(dat); - return ret; - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun ret = _play_x(van, sut, nog); - - u3z(nog); - return ret; - } - - case c3__dtwt: p_gen = u3t(gen); - _play_used(); - { - return _play_bean(); - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_bean(); - } - - case c3__dtls: p_gen = u3t(gen); - _play_used(); - { - return u3nt(c3__atom, u3_blip, u3_nul); - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_rock(p_gen, q_gen); - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return c3__noun; - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_sand(p_gen, q_gen); - } - - case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return u3k(p_gen); - } - - case c3__ktbr: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__iron); - - u3z(boc); - return pro; - } - - case c3__ktpd: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__zinc); - - u3z(boc); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__lead); - - u3z(boc); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, q_gen); - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun ret = u3qf_hint(hit, boc); - - u3z(hit); - u3z(boc); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _play_used(); - { - return u3qf_face(p_gen, sut); - } - - case c3__ktsg: p_gen = u3t(gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun ret = _play_x(van, boc, q_gen); - - u3z(boc); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun ret = _play_x(van, boc, q_gen); - - u3z(boc); - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_cnts(van, sut, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - u3_noun ret = _play_grow - (van, sut, c3__gold, p_gen, c3__dry, ruf, q_gen); - - u3z(ruf); - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - u3_noun ret = _play_grow - (van, sut, c3__gold, p_gen, c3__wet, ruf, q_gen); - - u3z(ruf); - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - u3_noun ret; - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _play_x(van, sut, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, q_gen); - } - - case c3__zpts: p_gen = u3t(gen); - _play_used(); - { - return c3__noun; - } - - case c3__ktcn: p_gen = u3t(gen); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _play_x(von, sut, p_gen); - - u3z(von); - return ret; - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3_noun ret; - -#if 0 - { - u3_noun cog = _play_loc_term(van, p_gen); - - u3t_heck(cog); - u3z(cog); - } -#endif - u3t_push(u3nc(c3__mean, _play_loc(van, p_gen))); - { - ret = _play_x(van, sut, q_gen); - } - u3t_drop(); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun zur = _play_x(van, sut, p_gen); - u3_noun vos = _play_x(van, sut, q_gen); - u3_noun ret = u3qf_cell(zur, vos); - - u3z(zur); - u3z(vos); - - return ret; - } - - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _play_used(); - { - if ( c3y == _play_feel(van, sut, p_gen) ) { - return _play_x(van, sut, q_gen); - } else { - return _play_x(van, sut, r_gen); - } - } - - case c3__lost: - case c3__fail: - case c3__zpzp: - _play_used(); - { - return c3__void; - } - } - } - static u3_noun _cqfu_play(u3_noun van, u3_noun sut, u3_noun gen) { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun ret = _play_x(von, sut, gen); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_play-play", von, "play"); - u3z(von); - return ret; + gat = u3i_molt(gat, u3x_sam, u3k(gen), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -578,7 +28,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_play(van, sut, gen); + return u3qfu_play(van, sut, gen); } } From f49e5aa5bdec0ef4ced35dc55f97234406ff7a70 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:17:08 -0700 Subject: [PATCH 11/23] dejet repo:ut --- pkg/urbit/jets/f/ut_repo.c | 56 ++++++-------------------------------- pkg/urbit/jets/tree.c | 5 +--- 2 files changed, 10 insertions(+), 51 deletions(-) diff --git a/pkg/urbit/jets/f/ut_repo.c b/pkg/urbit/jets/f/ut_repo.c index 569b7db455..c5f5bbc105 100644 --- a/pkg/urbit/jets/f/ut_repo.c +++ b/pkg/urbit/jets/f/ut_repo.c @@ -3,58 +3,20 @@ */ #include "all.h" + static u3_noun + _cqfu_repo(u3_noun van, + u3_noun sut) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + + return u3j_hook(von, "repo"); + } -/* logic -*/ u3_noun u3qfu_repo(u3_noun van, u3_noun sut) { - u3_noun p_sut, q_sut; - - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3k(sut); - - case c3__noun: { - return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), - u3nt(c3__cell, c3__noun, c3__noun), - u3_nul)); - } - } - else switch ( u3h(sut) ) { - default: { - u3m_p("head", u3h(sut)); - return u3m_error("repo-flat"); - } - - case c3__core: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) { - return u3m_bail(c3__fail); - } else { - return u3nt(c3__cell, c3__noun, u3k(p_sut)); - } - } - case c3__hint: - case c3__face: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { - return u3m_bail(c3__fail); - } else { - return u3k(q_sut); - } - } - case c3__hold: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { - return u3m_bail(c3__fail); - } else { - u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul); - u3_noun ret; - - ret = u3qfu_rest(van, sut, old); - u3z(old); - return ret; - } - } - } + return _cqfu_repo(van, sut); } u3_noun diff --git a/pkg/urbit/jets/tree.c b/pkg/urbit/jets/tree.c index 252530b590..8ea8b47525 100644 --- a/pkg/urbit/jets/tree.c +++ b/pkg/urbit/jets/tree.c @@ -502,10 +502,7 @@ static u3j_core _141_pen__ut_d[] = { "wrap", 7, _141_pen__ut_wrap_a, 0, _141_pen__ut_wrap_ha }, {} }; -static u3j_harm _141_pen__ut_a[] = - { {"repo", u3wfu_repo}, - {} - }; +static u3j_harm _141_pen__ut_a[] = {{}}; static c3_c* _141_pen__ut_ha[] = { "479d0051e5fabe291e4cded603a071fce0f10734503638fd7d30e9c6d799969c", From 00b70a9a2be79301802527c0b2b2a4af208651cb Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 18:37:28 -0700 Subject: [PATCH 12/23] decapitate rest:ut --- pkg/urbit/jets/f/ut_rest.c | 73 +++----------------------------------- 1 file changed, 5 insertions(+), 68 deletions(-) diff --git a/pkg/urbit/jets/f/ut_rest.c b/pkg/urbit/jets/f/ut_rest.c index 81edd85dfc..acaaba16a4 100644 --- a/pkg/urbit/jets/f/ut_rest.c +++ b/pkg/urbit/jets/f/ut_rest.c @@ -3,80 +3,17 @@ */ #include "all.h" - -/* logic -*/ - static u3_noun - _rest_in_list(u3_noun van, - u3_noun leg) - { - if ( u3_nul == leg ) { - return u3_nul; - } else { - u3_noun i_leg = u3h(leg); - u3_noun t_leg = u3t(leg); - - return u3nc(u3qfu_play(van, u3h(i_leg), u3t(i_leg)), - _rest_in_list(van, t_leg)); - } - } - - static u3_noun - _rest_in_stil(u3_noun van, - u3_noun gar) - { - u3_noun gun = u3qdi_gas(u3_nul, gar); - u3_noun yed = u3qdi_tap(gun); - - u3z(gun); - return yed; - } - - static u3_noun - _rest_in(u3_noun van, - u3_noun leg) - { - u3_noun gar = _rest_in_list(van, leg); - u3_noun yed = _rest_in_stil(van, gar); - u3_noun fub = u3qf_fork(yed); - - u3z(gar); - u3z(yed); - - return fub; - } - - static u3_noun - _rest_hit_fan(u3_noun fan, - u3_noun leg) - { - if ( u3_nul == leg ) { - return c3n; - } else { - return c3o(u3qdi_has(fan, u3h(leg)), - _rest_hit_fan(fan, u3t(leg))); - } - } - static u3_noun _cqfu_rest(u3_noun van, u3_noun sut, u3_noun leg) { - u3_noun fan = u3r_at(u3qfu_van_fan, van); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_rest-rest", von, "rest"); - if ( c3y == _rest_hit_fan(fan, leg) ) { - return u3m_error("rest-loop"); - } - else { - u3_noun naf = u3qdi_gas(fan, leg); - u3_noun nav = u3i_molt(u3k(van), u3qfu_van_fan, u3k(naf), 0); - u3_noun mez = _rest_in(nav, leg); + gat = u3i_molt(gat, u3x_sam, u3k(leg), 0); - u3z(naf); - u3z(nav); - return mez; - } + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -91,7 +28,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_rest(van, sut, leg); + return u3qfu_rest(van, sut, leg); } } From 762d4b5d83dd1b9864df56de776b5771bba21c85 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 18:43:03 -0700 Subject: [PATCH 13/23] decapitate toss:ut --- pkg/urbit/jets/f/ut_toss.c | 61 +++++--------------------------------- 1 file changed, 8 insertions(+), 53 deletions(-) diff --git a/pkg/urbit/jets/f/ut_toss.c b/pkg/urbit/jets/f/ut_toss.c index 15973cf581..d67b3dd32d 100644 --- a/pkg/urbit/jets/f/ut_toss.c +++ b/pkg/urbit/jets/f/ut_toss.c @@ -3,48 +3,6 @@ */ #include "all.h" - -/* internals -*/ - static u3_noun - _toss_in(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - if ( c3n == u3du(men) ) { - return u3nc(u3_nul, u3_nul); - } - else { - u3_noun i_men = u3h(men); - u3_noun pi_men = u3h(i_men); - u3_noun qi_men = u3t(i_men); - u3_noun t_men = u3t(men); - u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); - u3_noun p_geq = u3h(geq); - u3_noun q_geq = u3t(geq); - u3_noun mox = _toss_in(van, sut, peh, mur, t_men); - u3_noun p_mox = u3h(mox); - u3_noun q_mox = u3t(mox); - u3_noun ret; - - ret = u3nc( - ( (u3_nul == p_mox) - ? u3nc(u3_nul, u3k(p_geq)) - : (c3n == u3r_sing(p_geq, u3t(p_mox))) - ? u3m_bail(c3__exit) - : u3k(p_mox) ), - u3nc(u3nc(u3k(q_geq), u3k(qi_men)), u3k(q_mox))); - - u3z(mox); - u3z(geq); - return ret; - } - } - -/* functions -*/ u3_noun _cqfu_toss(u3_noun van, u3_noun sut, @@ -52,18 +10,15 @@ u3_noun mur, u3_noun men) { - u3_noun wib = _toss_in(van, sut, peh, mur, men); - u3_noun p_wib = u3h(wib); - u3_noun q_wib = u3t(wib); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_toss-toss", von, "toss"); - if ( u3_nul == p_wib ) { - return u3m_bail(c3__exit); - } else { - u3_noun ret = u3nc(u3k(u3t(p_wib)), u3k(q_wib)); + gat = u3i_molt(gat, u3x_sam_2, u3k(peh), + u3x_sam_6, u3k(mur), + u3x_sam_7, u3k(men), + 0); - u3z(wib); - return ret; - } + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -82,7 +37,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_toss(van, sut, peh, mur, men); + return u3qfu_toss(van, sut, peh, mur, men); } } From 30c47dac09cb07fdc0b58c482ab7c7452edc9a66 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 18:46:27 -0700 Subject: [PATCH 14/23] decapitate wrap:ut --- pkg/urbit/jets/f/ut_wrap.c | 66 +++----------------------------------- 1 file changed, 5 insertions(+), 61 deletions(-) diff --git a/pkg/urbit/jets/f/ut_wrap.c b/pkg/urbit/jets/f/ut_wrap.c index efa552bc8a..4b771c74d3 100644 --- a/pkg/urbit/jets/f/ut_wrap.c +++ b/pkg/urbit/jets/f/ut_wrap.c @@ -3,73 +3,17 @@ */ #include "all.h" - static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun); - - static u3_noun - _wrap_fork(u3_noun van, u3_noun p_sut, u3_noun yoz) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_cqfu_wrap(van, u3h(p_sut), yoz), - _wrap_fork(van, u3t(p_sut), yoz)); - } - } - static u3_noun _cqfu_wrap(u3_noun van, u3_noun sut, u3_noun yoz) { - u3_noun p_sut, q_sut; + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_wrap-wrap", von, "wrap"); - if ( c3n == u3du(sut) ) { - return u3m_error("wrap-type"); - } - else switch ( u3h(sut) ) { - default: return u3m_error("wrap-type"); + gat = u3i_molt(gat, u3x_sam, u3k(yoz), 0); - case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - - if ( c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut) ) { - return u3m_bail(c3__fail); - } - if ( c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut) ) { - return u3m_bail(c3__fail); - } - else if ( (c3__gold != rpq_sut) && - (c3__lead != yoz) ) { - return u3m_error("wrap-metal"); - } - else { - return u3nt(c3__core, - u3k(p_sut), - u3nt(u3nt(u3k(ppq_sut), u3k(qpq_sut), u3k(yoz)), - u3k(qq_sut), - u3k(rq_sut))); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _cqfu_wrap(van, fop, yoz); - - u3z(fop); - return pro; - } - } + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -84,7 +28,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_wrap(van, sut, yoz); + return u3qfu_wrap(van, sut, yoz); } } From a332bb17b20fc758d198c92f760d89fc9faec918 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 17 May 2019 11:46:18 -0700 Subject: [PATCH 15/23] kill conk:ut jet --- pkg/urbit/include/jets/g.h | 1 - pkg/urbit/include/jets/q.h | 1 - pkg/urbit/include/jets/w.h | 1 - pkg/urbit/include/jets/y.h | 1 - pkg/urbit/jets/f/ut_conk.c | 88 -------------------------------------- 5 files changed, 92 deletions(-) delete mode 100644 pkg/urbit/jets/f/ut_conk.c diff --git a/pkg/urbit/include/jets/g.h b/pkg/urbit/include/jets/g.h index 4561c01dde..aa0731f1c0 100644 --- a/pkg/urbit/include/jets/g.h +++ b/pkg/urbit/include/jets/g.h @@ -229,7 +229,6 @@ u3_noun u3gfu_busk(u3_noun, u3_noun, u3_noun); u3_noun u3gfu_buss(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3gfu_bust(u3_noun, u3_noun, u3_noun); - u3_noun u3gfu_conk(u3_noun, u3_noun, u3_noun); u3_noun u3gfu_crop(u3_noun, u3_noun, u3_noun); u3_noun u3gfu_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); u3_noun u3gfu_duck(u3_noun, u3_noun); diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 4cbe4eed94..f1ce62d67c 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -251,7 +251,6 @@ u3_noun u3qfu_busk(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_buss(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_bust(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_conk(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_crop(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); u3_noun u3qfu_duck(u3_noun, u3_noun); diff --git a/pkg/urbit/include/jets/w.h b/pkg/urbit/include/jets/w.h index 89f57cc57b..9216fdf3c2 100644 --- a/pkg/urbit/include/jets/w.h +++ b/pkg/urbit/include/jets/w.h @@ -272,7 +272,6 @@ u3_noun u3wfu_burn(u3_noun); u3_noun u3wfu_busk(u3_noun); u3_noun u3wfu_bust(u3_noun); - u3_noun u3wfu_conk(u3_noun); u3_noun u3wfu_crop(u3_noun); u3_noun u3wfu_cull(u3_noun); u3_noun u3wfu_duck(u3_noun); diff --git a/pkg/urbit/include/jets/y.h b/pkg/urbit/include/jets/y.h index 58b2595512..de009619fd 100644 --- a/pkg/urbit/include/jets/y.h +++ b/pkg/urbit/include/jets/y.h @@ -249,7 +249,6 @@ u3_noun u3yfu_burn(u3_noun); u3_noun u3yfu_busk(u3_noun); u3_noun u3yfu_bust(u3_noun); - u3_noun u3yfu_conk(u3_noun); u3_noun u3yfu_crop(u3_noun); u3_noun u3yfu_cull(u3_noun); u3_noun u3yfu_duck(u3_noun); diff --git a/pkg/urbit/jets/f/ut_conk.c b/pkg/urbit/jets/f/ut_conk.c deleted file mode 100644 index d851143a12..0000000000 --- a/pkg/urbit/jets/f/ut_conk.c +++ /dev/null @@ -1,88 +0,0 @@ -/* j/6/ut_conk.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _cqfu_conk(u3_noun van, - u3_noun sut, - u3_noun got) - { - if ( c3y == u3ud(got) ) { - u3_noun ret = u3qf_face(u3k(got), sut); - - return ret; - } - else switch ( u3h(got) ) { - default: return u3m_bail(c3__fail); - - case 0: { - return u3k(sut); - } - case 1: { - u3_noun cok = _cqfu_conk(van, sut, u3t(u3t(got))); - u3_noun nux = u3k(u3h(u3t(got))); - u3_noun ret = u3qf_face(nux, cok); - - u3z(nux); - u3z(cok); - return ret; - } - case 2: { - u3_noun vet = u3r_at(u3qfu_van_vet, van); - u3_noun hed, tal, deh, lat, ret; - - if ( c3y == vet ) { - u3_noun cel = u3nt(c3__cell, c3__noun, c3__noun); - - if ( c3n == u3qfu_nest(van, cel, c3y, sut) ) { - return u3m_bail(c3__fail); - } - u3z(cel); - } - hed = u3qfu_peek(van, sut, c3__both, 2); - tal = u3qfu_peek(van, sut, c3__both, 3); - deh = _cqfu_conk(van, hed, u3h(u3t(got))); - lat = _cqfu_conk(van, tal, u3t(u3t(got))); - - ret = u3qf_cell(deh, lat); - - u3z(lat); - u3z(deh); - u3z(tal); - u3z(hed); - - return ret; - } - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_conk(u3_noun cor) - { - u3_noun sut, got, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &got, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_conk(van, sut, got); - } - } - - u3_noun - u3qfu_conk(u3_noun van, - u3_noun sut, - u3_noun got) - { - return _cqfu_conk(van, sut, got); - } - From a5a9220284aa556e1481756a37f7dce55dd7f627 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 1 Aug 2019 10:56:15 -0700 Subject: [PATCH 16/23] decapitate nest:ut with caching for dext --- pkg/arvo/sys/hoon.hoon | 4 + pkg/urbit/include/jets/w.h | 1 + pkg/urbit/jets/f/ut_nest.c | 497 +++---------------------------------- pkg/urbit/jets/tree.c | 15 +- 4 files changed, 58 insertions(+), 459 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index b56547e881..56eea72f17 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -10559,6 +10559,7 @@ gil/(set {p/type q/type}) :: assume nest == =< dext + ~% %nest-in ..$ ~ |% ++ deem |= {mel/vair ram/vair} @@ -10595,6 +10596,9 @@ == == == :: ++ dext + =< $ + ~% %nest-dext + ~ + |. ^- ? =- ?: - & ?. tel | diff --git a/pkg/urbit/include/jets/w.h b/pkg/urbit/include/jets/w.h index 9216fdf3c2..ce7301a2d9 100644 --- a/pkg/urbit/include/jets/w.h +++ b/pkg/urbit/include/jets/w.h @@ -286,6 +286,7 @@ u3_noun u3wfu_mint(u3_noun); u3_noun u3wfu_mull(u3_noun); u3_noun u3wfu_nest(u3_noun); + u3_noun u3wfu_nest_dext(u3_noun); u3_noun u3wfu_peek(u3_noun); u3_noun u3wfu_peel(u3_noun); u3_noun u3wfu_play(u3_noun); diff --git a/pkg/urbit/jets/f/ut_nest.c b/pkg/urbit/jets/f/ut_nest.c index e8b6da1bef..c31b33a016 100644 --- a/pkg/urbit/jets/f/ut_nest.c +++ b/pkg/urbit/jets/f/ut_nest.c @@ -3,383 +3,8 @@ */ #include "all.h" -/* logic -*/ - /* forward - */ - static u3_noun - _nest_sint(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - static u3_noun - _nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - static u3_noun - _nest_deep(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun dab, - u3_noun hem, - u3_noun gil) - { - if ( u3_nul == dab ) { - return u3r_sing(u3_nul, hem); - } else if ( u3_nul == hem ) { - return c3n; - } else { - u3_noun n_dab, l_dab, r_dab; - u3_noun n_hem, l_hem, r_hem; - u3_noun pn_hem, qn_hem, pn_dab, qn_dab; - - u3x_trel(dab, &n_dab, &l_dab, &r_dab); - u3x_trel(hem, &n_hem, &l_hem, &r_hem); - - if ( (c3n == _nest_deep(van, sut, tel, ref, l_dab, l_hem, gil)) || - (c3n == _nest_deep(van, sut, tel, ref, r_dab, r_hem, gil)) ) - { - return c3n; - } - u3x_cell(n_dab, &pn_dab, &qn_dab); - u3x_cell(n_hem, &pn_hem, &qn_hem); - - if ( c3n == u3r_sing(pn_dab, pn_hem) ) { - return c3n; - } - else { - u3_noun vis = u3qfu_play(van, sut, qn_dab); - u3_noun lon = u3qfu_play(van, ref, qn_hem); - - u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); - - u3z(vis); - u3z(lon); - return ret; - } - } - } - - static u3_noun - _nest_dope(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun dom, - u3_noun vim, - u3_noun gil) - { - if ( u3_nul == dom ) { - return u3r_sing(u3_nul, vim); - } else if ( u3_nul == vim ) { - return c3n; - } else { - u3_noun n_dom, l_dom, r_dom; - u3_noun n_vim, l_vim, r_vim; - u3_noun pn_vim, qn_vim, pn_dom, qn_dom; - u3_noun pqn_vim, qqn_vim, pqn_dom, qqn_dom; - - u3x_trel(dom, &n_dom, &l_dom, &r_dom); - u3x_trel(vim, &n_vim, &l_vim, &r_vim); - - if ( (c3n == _nest_dope(van, sut, tel, ref, l_dom, l_vim, gil)) || - (c3n == _nest_dope(van, sut, tel, ref, r_dom, r_vim, gil)) ) - { - return c3n; - } - u3x_cell(n_dom, &pn_dom, &qn_dom); - u3x_cell(n_vim, &pn_vim, &qn_vim); - - u3x_cell(qn_dom, &pqn_dom, &qqn_dom); - u3x_cell(qn_vim, &pqn_vim, &qqn_vim); - - if ( c3n == u3r_sing(pn_dom, pn_vim) ) { - return c3n; - } else { - return _nest_deep(van, sut, tel, ref, qqn_dom, qqn_vim, gil); - } - } - } - - static u3_noun - _nest_cong(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun gil) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun pq_ref, qq_ref, rq_ref; - u3_noun prq_sut, qrq_sut, prq_ref, qrq_ref; - u3_noun ppq_sut, qpq_sut, rpq_sut; - u3_noun ppq_ref, qpq_ref, rpq_ref; - u3_noun ret; - - u3x_trel(sut, 0, &p_sut, &q_sut); - u3x_trel(ref, 0, &p_ref, &q_ref); - - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_trel(q_ref, &pq_ref, &qq_ref, &rq_ref); - - u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); - u3x_trel(pq_ref, &ppq_ref, &qpq_ref, &rpq_ref); - - u3x_cell(rq_sut, &prq_sut, &qrq_sut); - u3x_cell(rq_ref, &prq_ref, &qrq_ref); - - if ( c3y == u3r_sing(q_sut, q_ref) ) { - return _nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil); - } - else if ( c3n == u3r_sing(qpq_sut, qpq_ref) ) { - return c3n; - } - else if ( (c3n == _nest_dext - (van, qq_sut, tel, p_sut, u3_nul, u3_nul, gil)) || - (c3n == _nest_dext - (van, p_sut, tel, qq_sut, u3_nul, u3_nul, gil)) || - (c3n == _nest_dext - (van, qq_ref, tel, p_ref, u3_nul, u3_nul, gil)) ) - { - return c3n; - } - else { - if ( (rpq_sut != rpq_ref) && - (c3__lead != rpq_sut) && - (c3__gold != rpq_ref) ) - { - return c3n; - } - else if ( c3__wet == qpq_sut ) { - return u3r_sing(qrq_sut, qrq_ref); - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun tus = u3nt(c3__core, - u3k(qq_sut), - u3nc(u3nt(u3k(ppq_sut), u3k(qpq_sut), c3__gold), - u3k(u3t(q_sut)))); - - u3_noun fer = u3nt(c3__core, - u3k(qq_ref), - u3nc(u3nt(u3k(ppq_ref), u3k(qpq_ref), c3__gold), - u3k(u3t(q_ref)))); - - ret = _nest_dope(van, tus, tel, fer, qrq_sut, qrq_ref, zoc); - u3z(fer); - u3z(tus); - u3z(zoc); - u3z(hud); - - if ( c3n == ret ) { - return c3n; - } - else { - switch ( rpq_sut ) { - default: return u3m_bail(c3__fail); - - case c3__gold: { - return - c3a(_nest_dext(van, qq_sut, tel, qq_ref, u3_nul, u3_nul, gil), - _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil)); - } - case c3__iron: { - u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); - u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); - u3_noun ret = _nest_dext - (van, r_sam, tel, s_sam, u3_nul, u3_nul, gil); - - u3z(r_sam); - u3z(s_sam); - return ret; - } - case c3__lead: { - return c3y; - } - case c3__zinc: { - u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); - u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); - u3_noun ret = _nest_dext - (van, s_pal, tel, r_pal, u3_nul, u3_nul, gil); - - u3z(r_pal); - u3z(s_pal); - - return ret; - } - } - } - } - } - } - } - - static u3_noun - _nest_dext_in(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - - if ( (c3n == u3du(sut)) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return c3y; - } - case c3__void: { - return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } - else { - if ( c3y == u3r_pq(ref, c3__atom, &p_ref, &q_ref) ) { - if ( (c3n == u3qf_fitz(p_sut, p_ref)) || - ( (c3y == u3du(q_sut)) && - ( (c3n == u3du(q_ref)) || - (c3n == u3r_sing(q_sut, q_ref)))) ) - { - return c3n; - } - return c3y; - } - return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { - return c3a(_nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil), - _nest_dext(van, q_sut, tel, q_ref, u3_nul, u3_nul, gil)); - } - else return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__core: { - if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) { - return u3m_bail(c3__fail); - } else { - if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) { - return _nest_cong(van, sut, tel, ref, gil); - } - else return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _nest_dext(van, q_sut, tel, ref, seg, reg, gil); - } - } - case c3__fork: p_sut = u3t(sut); - { - if ( c3n == u3du(ref) ) switch ( ref ) { - default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); - - case c3__noun: - break; - } - else switch ( u3h(ref) ) { - default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); - - case c3__atom: - case c3__cell: - case c3__core: - break; - } - - { - u3_noun dey = u3qdi_tap(p_sut); - u3_noun yed = dey; - - while ( u3_nul != yed ) { - if ( c3y == _nest_dext(van, u3h(yed), c3n, ref, seg, reg, gil) ) { - u3z(dey); - return c3y; - } else { - yed = u3t(yed); - } - } - u3z(dey); - return c3n; - } - } - case c3__hold: - { - if ( c3y == u3qdi_has(seg, sut) ) { - return c3n; - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun gus = u3qdi_put(seg, sut); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc); - - u3z(hud); - u3z(fop); - u3z(zoc); - u3z(gus); - - return hiv; - } - } - } - } - } - - static u3_noun - _nest_dext_to(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - u3_noun tyn = _nest_dext_in(van, sut, tel, ref, seg, reg, gil); - - if ( (c3y == tyn) || (c3n == tel) ) { - return tyn; - } else { -#if 0 - u3_noun dun = u3qfu_dunq(van, "need", sut); - u3_noun niz = u3qfu_dunq(van, "have", ref); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -#endif - return u3m_error("nest-fail"); - } - } - - static u3_noun + /*static u3_noun _nest_dext(u3_noun van, u3_noun sut, u3_noun tel, @@ -411,105 +36,61 @@ else return pro; } } - } + }*/ - static u3_noun - _nest_sint(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) + u3_noun + u3wfu_nest_dext(u3_noun dext_core) { - u3_noun p_ref, q_ref; + u3_noun nest_in_core, nest_core; + u3_noun sut, ref, van, seg, reg, gil; - if ( (c3n == u3du(ref)) ) { - switch ( ref ) { - default: return u3m_bail(c3__fail); + if ( (u3_none == (nest_in_core = u3r_at(3, dext_core))) || + (c3n == u3r_mean(nest_in_core, u3x_sam_2, &seg, + u3x_sam_6, ®, + u3x_sam_7, &gil, + 7, &nest_core, + 0)) || + (c3n == u3r_mean(nest_core, u3x_sam_3, &ref, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + // XX Maybe it'd be nicer to use a different mote than c3__nest + // here. Meh. + c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); - case c3__noun: return c3n; - case c3__void: return c3y; + if ( u3_none != pro ) { + return pro; } - } - else { - switch ( u3h(ref) ) { - default: { - return u3m_bail(c3__fail); - } - case c3__atom: return c3n; - case c3__cell: return c3n; - case c3__core: { - u3_noun gam = u3qfu_repo(van, ref); - u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); + else { + pro = u3n_nock_on(u3k(dext_core), u3k(u3x_at(u3x_bat, dext_core))); - u3z(gam); - return hiv; - } - case c3__hint: - case c3__face: { - if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) { - return u3m_bail(c3__fail); - } else { - return _nest_dext(van, sut, tel, q_ref, seg, reg, gil); - } - } - case c3__fork: p_ref = u3t(ref); + if ( ((c3y == pro) && (u3_nul == reg)) || + ((c3n == pro) && (u3_nul == seg)) ) { - u3_noun dey = u3qdi_tap(p_ref); - u3_noun yed = dey; - - while ( u3_nul != yed ) { - if ( c3n == _nest_dext(van, sut, c3n, u3h(yed), seg, reg, gil) ) { - u3z(dey); - return c3n; - } else { - yed = u3t(yed); - } - } - u3z(dey); - return c3y; - } - case c3__hold: { - if ( c3y == u3qdi_has(reg, ref) ) { - return c3y; - } - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } else { - u3_noun gur = u3qdi_put(reg, ref); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun gam = u3qfu_repo(van, ref); - - { - u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc); - - u3z(hud); - u3z(gam); - u3z(zoc); - u3z(gur); - - return hiv; - } - } - } + return u3z_save_2(fun_m, sut, ref, pro); } + else return pro; } } } + static u3_noun _cqfu_nest(u3_noun van, u3_noun sut, u3_noun tel, u3_noun ref) { - return _nest_dext(van, sut, tel, ref, u3_nul, u3_nul, u3_nul); + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_nest-nest", von, "nest"); + + gat = u3i_molt(gat, u3x_sam_2, u3k(tel), u3x_sam_3, u3k(ref), 0); + + return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } /* boilerplate @@ -528,7 +109,7 @@ { return u3m_bail(c3__fail); } else { - return _cqfu_nest(van, sut, tel, ref); + return u3qfu_nest(van, sut, tel, ref); } } diff --git a/pkg/urbit/jets/tree.c b/pkg/urbit/jets/tree.c index 8ea8b47525..ee78a6bd0a 100644 --- a/pkg/urbit/jets/tree.c +++ b/pkg/urbit/jets/tree.c @@ -455,6 +455,19 @@ static c3_c* _141_pen_loot_ha[] = { 0 }; static u3j_harm _141_pen__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; + static u3j_harm _141_pen__ut_nest_dext_a[] = {{".2", u3wfu_nest_dext}, {}}; + static u3j_core _141_pen__ut_nest_in_d[] = + { + // TODO: compute hash + { "nest-dext", 3, _141_pen__ut_nest_dext_a, 0, 0 }, + {} + }; + static u3j_core _141_pen__ut_nest_d[] = + { + // TODO: Compute hash for nest-in. + { "nest-in", 7, 0, _141_pen__ut_nest_in_d, 0 }, + {} + }; static c3_c* _141_pen__ut_nest_ha[] = { "a55b695cdba00e7fa8f2c74a332880c877701555b2909b5b3028aea5839d62cd", 0 @@ -494,7 +507,7 @@ static u3j_core _141_pen__ut_d[] = { "fuse", 7, _141_pen__ut_fuse_a, 0, _141_pen__ut_fuse_ha }, { "mint", 7, _141_pen__ut_mint_a, 0, _141_pen__ut_mint_ha }, { "mull", 7, _141_pen__ut_mull_a, 0, _141_pen__ut_mull_ha }, - { "nest", 7, _141_pen__ut_nest_a, 0, _141_pen__ut_nest_ha }, + { "nest", 7, _141_pen__ut_nest_a, _141_pen__ut_nest_d, _141_pen__ut_nest_ha }, { "peek", 7, _141_pen__ut_peek_a, 0, _141_pen__ut_peek_ha }, { "play", 7, _141_pen__ut_play_a, 0, _141_pen__ut_play_ha }, { "rest", 7, _141_pen__ut_rest_a, 0, _141_pen__ut_rest_ha }, From 7a44ad8e0ee380cd6cb746091cadef06d3619214 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 1 Aug 2019 18:14:37 -0700 Subject: [PATCH 17/23] fix the %mean nest-fail in nest --- pkg/arvo/sys/hoon.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 56eea72f17..0b256219c6 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -10604,7 +10604,8 @@ ?. tel | :: ~_ (dunk %need) :: ~_ (dunk(sut ref) %have) - ~>(%mean.[%leaf "nest-fail"] !!) + ~_ [%leaf "nest-fail"] + !! ?: =(sut ref) & ?- sut $void sint From 6703dacc10edfb4881cf26d7f7305f47f90f4b9a Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 2 Aug 2019 13:26:07 -0700 Subject: [PATCH 18/23] update the pills; works! --- bin/ivory.pill | 4 ++-- bin/solid.pill | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ivory.pill b/bin/ivory.pill index b8eb687de6..6ba60285b1 100644 --- a/bin/ivory.pill +++ b/bin/ivory.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e520b9ab0232d1765e1dacde96a1210845768e7334a334b5705d1c40348c82b -size 4464201 +oid sha256:e151f640e4b5a47a9dce35d637e16ad998d5cfcc1a0d4b5744f8489869aac8ee +size 4544002 diff --git a/bin/solid.pill b/bin/solid.pill index 1a0fc416d7..ab1481032b 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4a8e1daf0bfe86d5fc4ef7060b0c6a6c2678a344787926f14bb4b8cfabe8752 -size 9549390 +oid sha256:06b4bb531ef974ab706eed7f9caef3e1cf5fe4c515b889c2b61cc2dc9e8187e6 +size 9626568 From 94f607699d4b6c9f1842f97a48a323a856fb0cfd Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 2 Aug 2019 15:14:43 -0700 Subject: [PATCH 19/23] remove unneeded jets, access to q jets --- pkg/urbit/include/jets/q.h | 39 -------------- pkg/urbit/include/jets/w.h | 12 ----- pkg/urbit/jets/f/ut.c | 101 ------------------------------------- pkg/urbit/jets/f/ut_buss.c | 93 ---------------------------------- pkg/urbit/jets/f/ut_crop.c | 32 ++++++------ pkg/urbit/jets/f/ut_find.c | 43 ++++++++-------- pkg/urbit/jets/f/ut_fire.c | 42 --------------- pkg/urbit/jets/f/ut_fish.c | 30 +++++------ pkg/urbit/jets/f/ut_fuse.c | 32 ++++++------ pkg/urbit/jets/f/ut_gain.c | 16 ------ pkg/urbit/jets/f/ut_lose.c | 16 ------ pkg/urbit/jets/f/ut_mint.c | 38 +++++++------- pkg/urbit/jets/f/ut_mull.c | 35 +++++++------ pkg/urbit/jets/f/ut_nest.c | 69 +++++++------------------ pkg/urbit/jets/f/ut_peek.c | 36 ++++++------- pkg/urbit/jets/f/ut_peel.c | 47 ----------------- pkg/urbit/jets/f/ut_play.c | 28 +++++----- pkg/urbit/jets/f/ut_repo.c | 32 ------------ pkg/urbit/jets/f/ut_rest.c | 28 +++++----- pkg/urbit/jets/f/ut_tack.c | 21 -------- pkg/urbit/jets/f/ut_toss.c | 52 ------------------- pkg/urbit/jets/f/ut_wrap.c | 41 --------------- pkg/urbit/jets/tree.c | 20 +------- 23 files changed, 169 insertions(+), 734 deletions(-) delete mode 100644 pkg/urbit/jets/f/ut.c delete mode 100644 pkg/urbit/jets/f/ut_buss.c delete mode 100644 pkg/urbit/jets/f/ut_fire.c delete mode 100644 pkg/urbit/jets/f/ut_gain.c delete mode 100644 pkg/urbit/jets/f/ut_lose.c delete mode 100644 pkg/urbit/jets/f/ut_peel.c delete mode 100644 pkg/urbit/jets/f/ut_repo.c delete mode 100644 pkg/urbit/jets/f/ut_tack.c delete mode 100644 pkg/urbit/jets/f/ut_toss.c delete mode 100644 pkg/urbit/jets/f/ut_wrap.c diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index f1ce62d67c..68f9466036 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -247,43 +247,4 @@ # define u3qfu_van_vet 118 # define u3qfu_van_fab 119 - u3_noun u3qfu_burn(u3_noun, u3_noun); - u3_noun u3qfu_busk(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_buss(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_bust(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_crop(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); - u3_noun u3qfu_duck(u3_noun, u3_noun); - u3_noun u3qfu_dung(u3_noun, u3_noun cap, u3_noun); - u3_noun u3qfu_dunq(u3_noun, const c3_c*, u3_noun); - void u3qfu_dump(u3_noun, const c3_c*, u3_noun); - u3_noun u3qfu_fond(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_find(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_fire(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_firm(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_fish(u3_noun, u3_noun, u3_atom); - u3_noun u3qfu_fuse(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_gain(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_heal(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_lose(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_mint(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_nest(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_nost(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_orth(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_peek(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_peel(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_play(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_repo(u3_noun, u3_noun); - u3_noun u3qfu_rest(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_shep(u3_noun, const c3_c*, u3_noun, u3_noun); - u3_noun u3qfu_shew(u3_noun, u3_noun); - u3_noun u3qfu_sift(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_snub(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_tack(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_wrap(u3_noun, u3_noun, u3_noun); - void u3qf_test(const c3_c*, u3_noun); diff --git a/pkg/urbit/include/jets/w.h b/pkg/urbit/include/jets/w.h index ce7301a2d9..c90b170160 100644 --- a/pkg/urbit/include/jets/w.h +++ b/pkg/urbit/include/jets/w.h @@ -269,29 +269,17 @@ u3_noun u3wfp_open(u3_noun); u3_noun u3wfp_rake(u3_noun); - u3_noun u3wfu_burn(u3_noun); u3_noun u3wfu_busk(u3_noun); - u3_noun u3wfu_bust(u3_noun); u3_noun u3wfu_crop(u3_noun); - u3_noun u3wfu_cull(u3_noun); - u3_noun u3wfu_duck(u3_noun); u3_noun u3wfu_find(u3_noun); u3_noun u3wfu_fond(u3_noun); - u3_noun u3wfu_fink(u3_noun); - u3_noun u3wfu_fire(u3_noun); - u3_noun u3wfu_firm(u3_noun); u3_noun u3wfu_fish(u3_noun); u3_noun u3wfu_fuse(u3_noun); - u3_noun u3wfu_heal(u3_noun); u3_noun u3wfu_mint(u3_noun); u3_noun u3wfu_mull(u3_noun); u3_noun u3wfu_nest(u3_noun); u3_noun u3wfu_nest_dext(u3_noun); u3_noun u3wfu_peek(u3_noun); - u3_noun u3wfu_peel(u3_noun); u3_noun u3wfu_play(u3_noun); u3_noun u3wfu_repo(u3_noun); u3_noun u3wfu_rest(u3_noun); - u3_noun u3wfu_snub(u3_noun); - u3_noun u3wfu_toss(u3_noun); - u3_noun u3wfu_wrap(u3_noun); diff --git a/pkg/urbit/jets/f/ut.c b/pkg/urbit/jets/f/ut.c deleted file mode 100644 index 5999bde517..0000000000 --- a/pkg/urbit/jets/f/ut.c +++ /dev/null @@ -1,101 +0,0 @@ -/* j/6/ut.c -** -*/ -#include "all.h" - -#if 0 - extern void - u3_pier_tank(c3_l tab_l, c3_w pri_w, u3_noun tac); -#endif - - // duck: create a duck core for mean. - // - u3_noun - u3qfu_duck(u3_noun van, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); - - u3z(von); - return ret; - } - - // dung: create a dunk core for mean (noun caption) - // - u3_noun - u3qfu_dung(u3_noun van, - u3_noun paz, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); - u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); - - u3z(duq); - u3z(von); - return ret; - } - - // dunq: create a dunk core for mean - // - u3_noun - u3qfu_dunq(u3_noun van, - const c3_c* paz_c, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); - u3_noun paz = u3i_string(paz_c); - u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); - - u3z(paz); - u3z(duq); - u3z(von); - return ret; - } - - // dump: dump a type. - // - void - u3qfu_dump(u3_noun van, - const c3_c* paz_c, - u3_noun typ) - { - c3_c* pfix_c = u3r_string((c3y == u3du(typ)) ? u3h(typ) : typ); - c3_c ugh_c[1024]; - - sprintf(ugh_c, "%s: %s: 0x%8x:", - paz_c, pfix_c, u3r_mug(typ)); -#if 0 - u3_pier_tank(0, 0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); -#endif - } - - // shew: create a show core for mean - // - u3_noun - u3qfu_shew(u3_noun van, - u3_noun mol) - { - u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(sho); - u3z(mol); - return ret; - } - - // shep: show with caption and style - // - u3_noun - u3qfu_shep(u3_noun van, - const c3_c* paz_c, - u3_noun sty, - u3_noun mol) - { - return u3qfu_shew(van, - u3nc(u3nc('c', u3i_string(paz_c)), - u3nc(u3k(sty), mol))); - } - diff --git a/pkg/urbit/jets/f/ut_buss.c b/pkg/urbit/jets/f/ut_buss.c deleted file mode 100644 index af9c5cccb7..0000000000 --- a/pkg/urbit/jets/f/ut_buss.c +++ /dev/null @@ -1,93 +0,0 @@ -/* j/6/ut_buss.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _cqfu_buss(u3_noun van, - u3_noun sut, - u3_noun cog, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(cog), - u3x_sam_3, - u3k(gen), - 0)); - } - - static u3_noun - _cqfu_busk(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(gen), - 0)); - } - -/* boilerplate -*/ - u3_noun - u3wfu_buss(u3_noun cor) - { - u3_noun sut, cog, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog, - u3x_sam_3, &gen, - u3x_con, &van, - 0)) || - (c3n == u3ud(cog)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_buss(van, sut, cog, gen); - } - } - - u3_noun - u3qfu_buss(u3_noun van, - u3_noun sut, - u3_noun cog, - u3_noun gen) - { - return _cqfu_buss(van, sut, cog, gen); - } - - - u3_noun - u3wfu_busk(u3_noun cor) - { - u3_noun sut, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_busk(van, sut, gen); - } - } - - u3_noun - u3qfu_busk(u3_noun van, - u3_noun sut, - u3_noun gen) - { - return _cqfu_busk(van, sut, gen); - } - diff --git a/pkg/urbit/jets/f/ut_crop.c b/pkg/urbit/jets/f/ut_crop.c index 67e079bd64..e7fe432437 100644 --- a/pkg/urbit/jets/f/ut_crop.c +++ b/pkg/urbit/jets/f/ut_crop.c @@ -15,22 +15,6 @@ return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } -/* boilerplate -*/ - u3_noun - u3wfu_crop(u3_noun cor) - { - u3_noun sut, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_crop(van, sut, ref); - } - } - u3_noun u3qfu_crop(u3_noun van, u3_noun sut, @@ -48,3 +32,19 @@ return u3z_save_2(fun_m, sut, ref, pro); } } + +/* boilerplate +*/ + u3_noun + u3wfu_crop(u3_noun cor) + { + u3_noun sut, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_crop(van, sut, ref); + } + } diff --git a/pkg/urbit/jets/f/ut_find.c b/pkg/urbit/jets/f/ut_find.c index 090805cff5..6095b3f2f6 100644 --- a/pkg/urbit/jets/f/ut_find.c +++ b/pkg/urbit/jets/f/ut_find.c @@ -33,23 +33,6 @@ /* boilerplate */ - u3_noun - u3wfu_find(u3_noun cor) - { - u3_noun sut, way, hyp, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &hyp, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_find(van, sut, way, hyp); - } - } - u3_noun u3qfu_find(u3_noun van, u3_noun sut, @@ -69,10 +52,8 @@ } } -/* boilerplate -*/ u3_noun - u3wfu_fond(u3_noun cor) + u3wfu_find(u3_noun cor) { u3_noun sut, way, hyp, van; @@ -84,10 +65,12 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_fond(van, sut, way, hyp); + return u3qfu_find(van, sut, way, hyp); } } +/* boilerplate +*/ u3_noun u3qfu_fond(u3_noun van, u3_noun sut, @@ -106,3 +89,21 @@ return u3z_save_3(fun_m, sut, way, hyp, pro); } } + + u3_noun + u3wfu_fond(u3_noun cor) + { + u3_noun sut, way, hyp, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &hyp, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_fond(van, sut, way, hyp); + } + } + diff --git a/pkg/urbit/jets/f/ut_fire.c b/pkg/urbit/jets/f/ut_fire.c deleted file mode 100644 index bcc73a5e38..0000000000 --- a/pkg/urbit/jets/f/ut_fire.c +++ /dev/null @@ -1,42 +0,0 @@ -/* j/6/fire.c -** -*/ -#include "all.h" - - static u3_noun - _cqfu_fire(u3_noun van, - u3_noun sut, - u3_noun hag) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_fire-fire", von, "fire"); - - gat = u3i_molt(gat, u3x_sam, u3k(hag), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - - } - -/* boilerplate -*/ - u3_noun - u3wfu_fire(u3_noun cor) - { - u3_noun sut, hag, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &hag, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_fire(van, sut, hag); - } - } - - u3_noun - u3qfu_fire(u3_noun van, - u3_noun sut, - u3_noun hag) - { - return _cqfu_fire(van, sut, hag); - } diff --git a/pkg/urbit/jets/f/ut_fish.c b/pkg/urbit/jets/f/ut_fish.c index cd14e00f64..5d32a6c0ad 100644 --- a/pkg/urbit/jets/f/ut_fish.c +++ b/pkg/urbit/jets/f/ut_fish.c @@ -20,21 +20,6 @@ /* boilerplate */ - u3_noun - u3wfu_fish(u3_noun cor) - { - u3_noun sut, axe, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &axe, u3x_con, &van, 0)) || - (c3n == u3ud(axe)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_fish(van, sut, axe); - } - } - u3_noun u3qfu_fish(u3_noun van, u3_noun sut, @@ -52,3 +37,18 @@ return u3z_save_2(fun_m, sut, axe, pro); } } + + u3_noun + u3wfu_fish(u3_noun cor) + { + u3_noun sut, axe, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &axe, u3x_con, &van, 0)) || + (c3n == u3ud(axe)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_fish(van, sut, axe); + } + } diff --git a/pkg/urbit/jets/f/ut_fuse.c b/pkg/urbit/jets/f/ut_fuse.c index f148533caa..c6d4e05916 100644 --- a/pkg/urbit/jets/f/ut_fuse.c +++ b/pkg/urbit/jets/f/ut_fuse.c @@ -17,22 +17,6 @@ } -/* boilerplate -*/ - u3_noun - u3wfu_fuse(u3_noun cor) - { - u3_noun sut, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_fuse(van, sut, ref); - } - } - u3_noun u3qfu_fuse(u3_noun van, u3_noun sut, @@ -50,3 +34,19 @@ return u3z_save_2(fun_m, sut, ref, pro); } } + +/* boilerplate +*/ + u3_noun + u3wfu_fuse(u3_noun cor) + { + u3_noun sut, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_fuse(van, sut, ref); + } + } diff --git a/pkg/urbit/jets/f/ut_gain.c b/pkg/urbit/jets/f/ut_gain.c deleted file mode 100644 index 5053667aff..0000000000 --- a/pkg/urbit/jets/f/ut_gain.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/gain.c -** -*/ -#include "all.h" - - - u3_noun - u3qfu_gain(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/pkg/urbit/jets/f/ut_lose.c b/pkg/urbit/jets/f/ut_lose.c deleted file mode 100644 index 16e9f6c0f0..0000000000 --- a/pkg/urbit/jets/f/ut_lose.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/lose.c -** -*/ -#include "all.h" - - - u3_noun - u3qfu_lose(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/pkg/urbit/jets/f/ut_mint.c b/pkg/urbit/jets/f/ut_mint.c index 9fbe30369c..82500bb6a8 100644 --- a/pkg/urbit/jets/f/ut_mint.c +++ b/pkg/urbit/jets/f/ut_mint.c @@ -17,25 +17,6 @@ return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } -/* boilerplate -*/ - u3_noun - u3wfu_mint(u3_noun cor) - { - u3_noun sut, gol, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, - u3x_sam_3, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_mint(van, sut, gol, gen); - } - } - u3_noun u3qfu_mint(u3_noun van, u3_noun sut, @@ -55,3 +36,22 @@ return u3z_save_4(fun_m, vrf, sut, gol, gen, pro); } } + +/* boilerplate +*/ + u3_noun + u3wfu_mint(u3_noun cor) + { + u3_noun sut, gol, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, + u3x_sam_3, &gen, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_mint(van, sut, gol, gen); + } + } diff --git a/pkg/urbit/jets/f/ut_mull.c b/pkg/urbit/jets/f/ut_mull.c index 900014aac8..078fd5cc20 100644 --- a/pkg/urbit/jets/f/ut_mull.c +++ b/pkg/urbit/jets/f/ut_mull.c @@ -23,24 +23,6 @@ /* boilerplate */ - u3_noun - u3wfu_mull(u3_noun cor) - { - u3_noun sut, gol, dox, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, - u3x_sam_6, &dox, - u3x_sam_7, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_mull(van, sut, gol, dox, gen); - } - } - u3_noun u3qfu_mull(u3_noun van, u3_noun sut, @@ -61,3 +43,20 @@ } } + u3_noun + u3wfu_mull(u3_noun cor) + { + u3_noun sut, gol, dox, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, + u3x_sam_6, &dox, + u3x_sam_7, &gen, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_mull(van, sut, gol, dox, gen); + } + } diff --git a/pkg/urbit/jets/f/ut_nest.c b/pkg/urbit/jets/f/ut_nest.c index c31b33a016..2251411d66 100644 --- a/pkg/urbit/jets/f/ut_nest.c +++ b/pkg/urbit/jets/f/ut_nest.c @@ -4,40 +4,6 @@ #include "all.h" - /*static u3_noun - _nest_dext(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - - if ( (c3y == u3r_sing(sut, ref)) ) { - return c3y; - } - - { - c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _nest_dext_to(van, sut, tel, ref, seg, reg, gil); - - if ( ((c3y == pro) && (u3_nul == reg)) || - ((c3n == pro) && (u3_nul == seg)) ) - { - return u3z_save_2(fun_m, sut, ref, pro); - } - else return pro; - } - } - }*/ - u3_noun u3wfu_nest_dext(u3_noun dext_core) { @@ -95,24 +61,6 @@ /* boilerplate */ - u3_noun - u3wfu_nest(u3_noun cor) - { - u3_noun sut, tel, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &tel, - u3x_sam_3, &ref, - u3x_con, &van, - 0)) || - (c3n == u3ud(tel)) || (tel > 1) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_nest(van, sut, tel, ref); - } - } - u3_noun u3qfu_nest(u3_noun van, u3_noun sut, @@ -139,3 +87,20 @@ #endif } + u3_noun + u3wfu_nest(u3_noun cor) + { + u3_noun sut, tel, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &tel, + u3x_sam_3, &ref, + u3x_con, &van, + 0)) || + (c3n == u3ud(tel)) || (tel > 1) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_nest(van, sut, tel, ref); + } + } diff --git a/pkg/urbit/jets/f/ut_peek.c b/pkg/urbit/jets/f/ut_peek.c index efdcb89f0d..b33c48f0be 100644 --- a/pkg/urbit/jets/f/ut_peek.c +++ b/pkg/urbit/jets/f/ut_peek.c @@ -19,24 +19,6 @@ /* boilerplate */ - u3_noun - u3wfu_peek(u3_noun cor) - { - u3_noun sut, way, axe, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &axe, - u3x_con, &van, - 0)) || - (c3n == u3ud(axe)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_peek(van, sut, way, axe); - } - } - u3_noun u3qfu_peek(u3_noun van, u3_noun sut, @@ -55,3 +37,21 @@ return u3z_save_3(fun_m, sut, way, axe, pro); } } + + u3_noun + u3wfu_peek(u3_noun cor) + { + u3_noun sut, way, axe, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &axe, + u3x_con, &van, + 0)) || + (c3n == u3ud(axe)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_peek(van, sut, way, axe); + } + } diff --git a/pkg/urbit/jets/f/ut_peel.c b/pkg/urbit/jets/f/ut_peel.c deleted file mode 100644 index b3d3e21227..0000000000 --- a/pkg/urbit/jets/f/ut_peel.c +++ /dev/null @@ -1,47 +0,0 @@ -/* j/6/ut_peel.c -** -*/ -#include "all.h" - - u3_noun - _cqfu_peel(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun axe) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_peel-peel", von, "peel"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(axe), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3wfu_peel(u3_noun cor) - { - u3_noun sut, way, axe, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &axe, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_peel(van, sut, way, axe); - } - } - - u3_noun - u3qfu_peel(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun axe) - { - return _cqfu_peel(van, sut, way, axe); - } - diff --git a/pkg/urbit/jets/f/ut_play.c b/pkg/urbit/jets/f/ut_play.c index 899135263f..6778c682bf 100644 --- a/pkg/urbit/jets/f/ut_play.c +++ b/pkg/urbit/jets/f/ut_play.c @@ -18,20 +18,6 @@ /* boilerplate */ - u3_noun - u3wfu_play(u3_noun cor) - { - u3_noun sut, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &gen, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_play(van, sut, gen); - } - } - u3_noun u3qfu_play(u3_noun van, u3_noun sut, @@ -54,3 +40,17 @@ return _cqfu_play(van, sut, gen); #endif } + + u3_noun + u3wfu_play(u3_noun cor) + { + u3_noun sut, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &gen, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_play(van, sut, gen); + } + } diff --git a/pkg/urbit/jets/f/ut_repo.c b/pkg/urbit/jets/f/ut_repo.c deleted file mode 100644 index c5f5bbc105..0000000000 --- a/pkg/urbit/jets/f/ut_repo.c +++ /dev/null @@ -1,32 +0,0 @@ -/* j/6/ut_repo.c -** -*/ -#include "all.h" - - static u3_noun - _cqfu_repo(u3_noun van, - u3_noun sut) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - - return u3j_hook(von, "repo"); - } - - u3_noun - u3qfu_repo(u3_noun van, - u3_noun sut) - { - return _cqfu_repo(van, sut); - } - - u3_noun - u3wfu_repo(u3_noun cor) - { - u3_noun sut; - - if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3qfu_repo(cor, sut); - } - } diff --git a/pkg/urbit/jets/f/ut_rest.c b/pkg/urbit/jets/f/ut_rest.c index acaaba16a4..ee6bb12a84 100644 --- a/pkg/urbit/jets/f/ut_rest.c +++ b/pkg/urbit/jets/f/ut_rest.c @@ -18,20 +18,6 @@ /* boilerplate */ - u3_noun - u3wfu_rest(u3_noun cor) - { - u3_noun sut, leg, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &leg, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_rest(van, sut, leg); - } - } - u3_noun u3qfu_rest(u3_noun van, u3_noun sut, @@ -48,4 +34,18 @@ return u3z_save_2(fun_m, sut, leg, pro); } + } + + u3_noun + u3wfu_rest(u3_noun cor) + { + u3_noun sut, leg, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &leg, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return u3qfu_rest(van, sut, leg); + } } diff --git a/pkg/urbit/jets/f/ut_tack.c b/pkg/urbit/jets/f/ut_tack.c deleted file mode 100644 index 8e13ac1544..0000000000 --- a/pkg/urbit/jets/f/ut_tack.c +++ /dev/null @@ -1,21 +0,0 @@ -/* j/6/tack.c -** -*/ -#include "all.h" - - u3_noun - u3qfu_tack(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun mur) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(hyp), - u3x_sam_3, - u3k(mur), - 0)); - } diff --git a/pkg/urbit/jets/f/ut_toss.c b/pkg/urbit/jets/f/ut_toss.c deleted file mode 100644 index d67b3dd32d..0000000000 --- a/pkg/urbit/jets/f/ut_toss.c +++ /dev/null @@ -1,52 +0,0 @@ -/* j/6/toss.c -** -*/ -#include "all.h" - - u3_noun - _cqfu_toss(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_toss-toss", von, "toss"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(peh), - u3x_sam_6, u3k(mur), - u3x_sam_7, u3k(men), - 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3wfu_toss(u3_noun cor) - { - u3_noun van, sut, peh, mur, men; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &peh, - u3x_sam_6, &mur, - u3x_sam_7, &men, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_toss(van, sut, peh, mur, men); - } - } - - u3_noun - u3qfu_toss(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - return _cqfu_toss(van, sut, peh, mur, men); - } diff --git a/pkg/urbit/jets/f/ut_wrap.c b/pkg/urbit/jets/f/ut_wrap.c deleted file mode 100644 index 4b771c74d3..0000000000 --- a/pkg/urbit/jets/f/ut_wrap.c +++ /dev/null @@ -1,41 +0,0 @@ -/* j/6/wrap.c -** -*/ -#include "all.h" - - static u3_noun - _cqfu_wrap(u3_noun van, - u3_noun sut, - u3_noun yoz) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_wrap-wrap", von, "wrap"); - - gat = u3i_molt(gat, u3x_sam, u3k(yoz), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3wfu_wrap(u3_noun cor) - { - u3_noun sut, yoz, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &yoz, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return u3qfu_wrap(van, sut, yoz); - } - } - - u3_noun - u3qfu_wrap(u3_noun van, - u3_noun sut, - u3_noun yoz) - { - return _cqfu_wrap(van, sut, yoz); - } diff --git a/pkg/urbit/jets/tree.c b/pkg/urbit/jets/tree.c index ee78a6bd0a..b3ee13862f 100644 --- a/pkg/urbit/jets/tree.c +++ b/pkg/urbit/jets/tree.c @@ -425,10 +425,6 @@ static c3_c* _141_pen_loot_ha[] = { "d83e5e47f712870aba815d79943d287cbefdc00640409464b30bf755115d4a1a", 0 }; - // XX no longer hinted in +ut - // - static u3j_harm _141_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; - static c3_c* _141_pen__ut_fire_ha[] = {0}; static u3j_harm _141_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}}; static c3_c* _141_pen__ut_fond_ha[] = { "0da0cc79c938eb06515a5cc24a17b82cd60a50c0f1a02e2c68e5d1cf71c96054", @@ -487,22 +483,11 @@ static c3_c* _141_pen_loot_ha[] = { "2e2d15f3efca0a4bf8ce08cca48c54d1d5a7204e2b0525137f59c3e7b037d2fd", 0 }; - static u3j_harm _141_pen__ut_toss_a[] = {{".2", u3wfu_toss}, {}}; - static c3_c* _141_pen__ut_toss_ha[] = { - "2a77e7e2693231d3f6b4bbc2a4c961691702da1fdddaa8f15f06e9ad437c9416", - 0 - }; - static u3j_harm _141_pen__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; - static c3_c* _141_pen__ut_wrap_ha[] = { - "128f42e2e3a299c2890f0b68e0301885620bae8491dd0a36cde7a94023eb4226", - 0 - }; static u3j_core _141_pen__ut_d[] = { { "crop", 7, _141_pen__ut_crop_a, 0, _141_pen__ut_crop_ha }, { "fond", 7, _141_pen__ut_fond_a, 0, _141_pen__ut_fond_ha }, - { "fire", 7, _141_pen__ut_fire_a, 0, _141_pen__ut_fire_ha }, { "fish", 7, _141_pen__ut_fish_a, 0, _141_pen__ut_fish_ha }, { "fuse", 7, _141_pen__ut_fuse_a, 0, _141_pen__ut_fuse_ha }, { "mint", 7, _141_pen__ut_mint_a, 0, _141_pen__ut_mint_ha }, @@ -511,11 +496,8 @@ static u3j_core _141_pen__ut_d[] = { "peek", 7, _141_pen__ut_peek_a, 0, _141_pen__ut_peek_ha }, { "play", 7, _141_pen__ut_play_a, 0, _141_pen__ut_play_ha }, { "rest", 7, _141_pen__ut_rest_a, 0, _141_pen__ut_rest_ha }, - { "toss", 7, _141_pen__ut_toss_a, 0, _141_pen__ut_toss_ha }, - { "wrap", 7, _141_pen__ut_wrap_a, 0, _141_pen__ut_wrap_ha }, {} }; -static u3j_harm _141_pen__ut_a[] = {{}}; static c3_c* _141_pen__ut_ha[] = { "479d0051e5fabe291e4cded603a071fce0f10734503638fd7d30e9c6d799969c", @@ -607,7 +589,7 @@ static u3j_core _141_pen_d[] = // { "ap", 7, _141_pen__ap_a, 0, _141_pen__ap_ha }, // { "al", 7, _141_pen__al_a, 0, _141_pen__al_ha }, - { "ut", 15, _141_pen__ut_a, _141_pen__ut_d, _141_pen__ut_ha, _141_pen__ut_ho }, + { "ut", 15, 0, _141_pen__ut_d, _141_pen__ut_ha, _141_pen__ut_ho }, {} }; static c3_c* _141_pen_ha[] = { From 4a2c3924720ccc287106b93167fcacdfd9eb7cf2 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 2 Aug 2019 16:06:16 -0700 Subject: [PATCH 20/23] rm q jets, unneeded molting and cooking --- pkg/urbit/jets/f/ut_crop.c | 44 +++++-------------- pkg/urbit/jets/f/ut_find.c | 90 +++++++++----------------------------- pkg/urbit/jets/f/ut_fish.c | 47 +++++--------------- pkg/urbit/jets/f/ut_fuse.c | 46 +++++-------------- pkg/urbit/jets/f/ut_mint.c | 49 +++++---------------- pkg/urbit/jets/f/ut_mull.c | 52 +++++----------------- pkg/urbit/jets/f/ut_nest.c | 58 ++++++------------------ pkg/urbit/jets/f/ut_peek.c | 47 +++++--------------- pkg/urbit/jets/f/ut_play.c | 51 +++++---------------- pkg/urbit/jets/f/ut_rest.c | 45 +++++-------------- 10 files changed, 124 insertions(+), 405 deletions(-) diff --git a/pkg/urbit/jets/f/ut_crop.c b/pkg/urbit/jets/f/ut_crop.c index e7fe432437..1937c0b545 100644 --- a/pkg/urbit/jets/f/ut_crop.c +++ b/pkg/urbit/jets/f/ut_crop.c @@ -3,38 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_crop(u3_noun van, - u3_noun sut, - u3_noun ref) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_crop-crop", von, "crop"); - gat = u3i_molt(gat, u3x_sam, u3k(ref), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - - u3_noun - u3qfu_crop(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_crop(van, sut, ref); - - return u3z_save_2(fun_m, sut, ref, pro); - } - } - -/* boilerplate -*/ u3_noun u3wfu_crop(u3_noun cor) { @@ -45,6 +13,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_crop(van, sut, ref); + c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_2(fun_m, sut, ref, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_find.c b/pkg/urbit/jets/f/ut_find.c index 6095b3f2f6..a5b62dd0ef 100644 --- a/pkg/urbit/jets/f/ut_find.c +++ b/pkg/urbit/jets/f/ut_find.c @@ -3,55 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_fond(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_fond-fond", von, "fond"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(hyp), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - - static u3_noun - _cqfu_find(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_find-find", von, "find"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(hyp), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3qfu_find(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_find(van, sut, way, hyp); - - return u3z_save_3(fun_m, sut, way, hyp, pro); - } - } - u3_noun u3wfu_find(u3_noun cor) { @@ -65,28 +16,17 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_find(van, sut, way, hyp); - } - } + c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); -/* boilerplate -*/ - u3_noun - u3qfu_fond(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fond(van, sut, way, hyp); - - return u3z_save_3(fun_m, sut, way, hyp, pro); + return u3z_save_3(fun_m, sut, way, hyp, pro); + } } } @@ -103,7 +43,17 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_fond(van, sut, way, hyp); + c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_3(fun_m, sut, way, hyp, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_fish.c b/pkg/urbit/jets/f/ut_fish.c index 5d32a6c0ad..96fbcb5283 100644 --- a/pkg/urbit/jets/f/ut_fish.c +++ b/pkg/urbit/jets/f/ut_fish.c @@ -3,41 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_fish(u3_noun van, - u3_noun sut, - u3_atom axe) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_fish-fish", von, "fish"); - - gat = u3i_molt(gat, u3x_sam, u3k(axe), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - - } - - -/* boilerplate -*/ - u3_noun - u3qfu_fish(u3_noun van, - u3_noun sut, - u3_noun axe) - { - c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, axe); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fish(van, sut, axe); - - return u3z_save_2(fun_m, sut, axe, pro); - } - } - u3_noun u3wfu_fish(u3_noun cor) { @@ -49,6 +14,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_fish(van, sut, axe); + c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, axe); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_2(fun_m, sut, axe, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_fuse.c b/pkg/urbit/jets/f/ut_fuse.c index c6d4e05916..33cf0933a0 100644 --- a/pkg/urbit/jets/f/ut_fuse.c +++ b/pkg/urbit/jets/f/ut_fuse.c @@ -3,40 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_fuse(u3_noun van, - u3_noun sut, - u3_noun ref) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_fuse-fuse", von, "fuse"); - - gat = u3i_molt(gat, u3x_sam, u3k(ref), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - - } - - u3_noun - u3qfu_fuse(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fuse(van, sut, ref); - - return u3z_save_2(fun_m, sut, ref, pro); - } - } - -/* boilerplate -*/ u3_noun u3wfu_fuse(u3_noun cor) { @@ -47,6 +13,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_fuse(van, sut, ref); + c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_2(fun_m, sut, ref, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_mint.c b/pkg/urbit/jets/f/ut_mint.c index 82500bb6a8..b2a1b731c2 100644 --- a/pkg/urbit/jets/f/ut_mint.c +++ b/pkg/urbit/jets/f/ut_mint.c @@ -3,42 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_mint(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_mint-mint", von, "mint"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(gol), u3x_sam_3, u3k(gen), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - - u3_noun - u3qfu_mint(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - c3_m fun_m = 141 + c3__mint; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_mint(van, sut, gol, gen); - - return u3z_save_4(fun_m, vrf, sut, gol, gen, pro); - } - } - -/* boilerplate -*/ u3_noun u3wfu_mint(u3_noun cor) { @@ -52,6 +16,17 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_mint(van, sut, gol, gen); + c3_m fun_m = 141 + c3__mint; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_4(fun_m, vrf, sut, gol, gen, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_mull.c b/pkg/urbit/jets/f/ut_mull.c index 078fd5cc20..550600bc4b 100644 --- a/pkg/urbit/jets/f/ut_mull.c +++ b/pkg/urbit/jets/f/ut_mull.c @@ -3,46 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_mull(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_mull-mull", von, "mull"); - - gat = u3i_molt(gat, - u3x_sam_2, u3k(gol), - u3x_sam_6, u3k(dox), - u3x_sam_7, u3k(gen), - 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); } - -/* boilerplate -*/ - u3_noun - u3qfu_mull(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_mull(van, sut, gol, dox, gen); - - return u3z_save_4(fun_m, sut, gol, dox, gen, pro); - } - } - u3_noun u3wfu_mull(u3_noun cor) { @@ -57,6 +17,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_mull(van, sut, gol, dox, gen); + c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_4(fun_m, sut, gol, dox, gen, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_nest.c b/pkg/urbit/jets/f/ut_nest.c index 2251411d66..04dc08bddc 100644 --- a/pkg/urbit/jets/f/ut_nest.c +++ b/pkg/urbit/jets/f/ut_nest.c @@ -44,49 +44,6 @@ } } - - static u3_noun - _cqfu_nest(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_nest-nest", von, "nest"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(tel), u3x_sam_3, u3k(ref), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3qfu_nest(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref) - { -#if 1 - c3_m fun_m = 141 + c3__nest; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); - - if ( u3_none != pro ) { - // u3t_heck(c3__good); - return pro; - } - else { - pro = _cqfu_nest(van, sut, tel, ref); - - // u3t_heck(c3__nest); - return u3z_save_4(fun_m, vrf, sut, tel, ref, pro); - } -#else - return _cqfu_nest(van, sut, tel, ref); -#endif - } - u3_noun u3wfu_nest(u3_noun cor) { @@ -101,6 +58,19 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_nest(van, sut, tel, ref); + c3_m fun_m = 141 + c3__nest; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); + + if ( u3_none != pro ) { + // u3t_heck(c3__good); + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + // u3t_heck(c3__nest); + return u3z_save_4(fun_m, vrf, sut, tel, ref, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_peek.c b/pkg/urbit/jets/f/ut_peek.c index b33c48f0be..2fd8fb2960 100644 --- a/pkg/urbit/jets/f/ut_peek.c +++ b/pkg/urbit/jets/f/ut_peek.c @@ -3,41 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_peek(u3_noun van, - u3_noun sut, - u3_noun way, - u3_atom axe) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_peek-peek", von, "peek"); - - gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(axe), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3qfu_peek(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun axe) - { - c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, axe); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_peek(van, sut, way, axe); - - return u3z_save_3(fun_m, sut, way, axe, pro); - } - } - u3_noun u3wfu_peek(u3_noun cor) { @@ -52,6 +17,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_peek(van, sut, way, axe); + c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, axe); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_3(fun_m, sut, way, axe, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_play.c b/pkg/urbit/jets/f/ut_play.c index 6778c682bf..32d9c0b07d 100644 --- a/pkg/urbit/jets/f/ut_play.c +++ b/pkg/urbit/jets/f/ut_play.c @@ -3,44 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_play(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_play-play", von, "play"); - - gat = u3i_molt(gat, u3x_sam, u3k(gen), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3qfu_play(u3_noun van, - u3_noun sut, - u3_noun gen) - { -#if 1 - c3_m fun_m = 141 + c3__play; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_play(van, sut, gen); - - return u3z_save_3(fun_m, vrf, sut, gen, pro); - } -#else - return _cqfu_play(van, sut, gen); -#endif - } - u3_noun u3wfu_play(u3_noun cor) { @@ -51,6 +13,17 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_play(van, sut, gen); + c3_m fun_m = 141 + c3__play; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_3(fun_m, vrf, sut, gen, pro); + } } } diff --git a/pkg/urbit/jets/f/ut_rest.c b/pkg/urbit/jets/f/ut_rest.c index ee6bb12a84..46bae33e4d 100644 --- a/pkg/urbit/jets/f/ut_rest.c +++ b/pkg/urbit/jets/f/ut_rest.c @@ -3,39 +3,6 @@ */ #include "all.h" - static u3_noun - _cqfu_rest(u3_noun van, - u3_noun sut, - u3_noun leg) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_rest-rest", von, "rest"); - - gat = u3i_molt(gat, u3x_sam, u3k(leg), 0); - - return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat))); - } - -/* boilerplate -*/ - u3_noun - u3qfu_rest(u3_noun van, - u3_noun sut, - u3_noun leg) - { - c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, leg); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_rest(van, sut, leg); - - return u3z_save_2(fun_m, sut, leg, pro); - } - } - u3_noun u3wfu_rest(u3_noun cor) { @@ -46,6 +13,16 @@ { return u3m_bail(c3__fail); } else { - return u3qfu_rest(van, sut, leg); + c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, leg); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = u3n_nock_on(u3k(cor), u3k(u3x_at(u3x_bat, cor))); + + return u3z_save_2(fun_m, sut, leg, pro); + } } } From 1c243a115493a2acbf609a238ca3952f4ddf5bfa Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 9 Aug 2019 11:38:44 -0700 Subject: [PATCH 21/23] address joe's feedback (except mean) --- pkg/urbit/include/c/motes.h | 1 + pkg/urbit/jets/f/ut_nest.c | 4 +--- pkg/urbit/jets/tree.c | 13 +++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pkg/urbit/include/c/motes.h b/pkg/urbit/include/c/motes.h index bb57e96bb4..d0dfa6cfef 100644 --- a/pkg/urbit/include/c/motes.h +++ b/pkg/urbit/include/c/motes.h @@ -298,6 +298,7 @@ # define c3__delc c3_s4('d','e','l','c') # define c3__delt c3_s4('d','e','l','t') # define c3__dept c3_s4('d','e','p','t') +# define c3__dext c3_s4('d','e','x','t') # define c3__dgdp c3_s4('d','g','d','p') # define c3__dgkt c3_s4('d','g','k','t') # define c3__dgnp c3_s4('d','g','n','p') diff --git a/pkg/urbit/jets/f/ut_nest.c b/pkg/urbit/jets/f/ut_nest.c index 04dc08bddc..7c246b9d2a 100644 --- a/pkg/urbit/jets/f/ut_nest.c +++ b/pkg/urbit/jets/f/ut_nest.c @@ -23,9 +23,7 @@ { return u3m_bail(c3__fail); } else { - // XX Maybe it'd be nicer to use a different mote than c3__nest - // here. Meh. - c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__dext + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { diff --git a/pkg/urbit/jets/tree.c b/pkg/urbit/jets/tree.c index b3ee13862f..16459f62dc 100644 --- a/pkg/urbit/jets/tree.c +++ b/pkg/urbit/jets/tree.c @@ -451,23 +451,20 @@ static c3_c* _141_pen_loot_ha[] = { 0 }; static u3j_harm _141_pen__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; + static c3_c* _141_pen__ut_nest_ha[] = {0}; static u3j_harm _141_pen__ut_nest_dext_a[] = {{".2", u3wfu_nest_dext}, {}}; + static c3_c* _141_pen__ut_nest_dext_ha[] = {0}; static u3j_core _141_pen__ut_nest_in_d[] = { - // TODO: compute hash - { "nest-dext", 3, _141_pen__ut_nest_dext_a, 0, 0 }, + { "nest-dext", 3, _141_pen__ut_nest_dext_a, 0, _141_pen__ut_nest_dext_ha }, {} }; + static c3_c* _141_pen__ut_nest_in_ha[] = {0}; static u3j_core _141_pen__ut_nest_d[] = { - // TODO: Compute hash for nest-in. - { "nest-in", 7, 0, _141_pen__ut_nest_in_d, 0 }, + { "nest-in", 7, 0, _141_pen__ut_nest_in_d, _141_pen__ut_nest_in_ha }, {} }; - static c3_c* _141_pen__ut_nest_ha[] = { - "a55b695cdba00e7fa8f2c74a332880c877701555b2909b5b3028aea5839d62cd", - 0 - }; static u3j_harm _141_pen__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; static c3_c* _141_pen__ut_peek_ha[] = { "904ff7359e89d1886f884c4409f104269cdb8dfb4683f116ff00bc98a4720df7", From 9997accabfe2e961a12d566486290e8fd4a2e81a Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 9 Aug 2019 13:56:01 -0700 Subject: [PATCH 22/23] fix the %mean hints --- pkg/arvo/sys/hoon.hoon | 69 +++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 0b256219c6..b5c027eed7 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -481,12 +481,12 @@ |* {a/(unit) b/(unit)} ?~ b a ?~ a b - ?.(=(u.a u.b) ~>(%mean.[%leaf "mate"] !!) a) + ?.(=(u.a u.b) ~>(%mean.'mate' !!) a) :: ++ need :: demand ~/ %need |* a/(unit) - ?~ a ~>(%mean.[%leaf "need"] !!) + ?~ a ~>(%mean.'need' !!) u.a :: ++ some :: lift (pure) @@ -8927,7 +8927,7 @@ * gen == :: - ++ rake ~>(%mean.[%leaf "rake-hoon"] (need reek)) + ++ rake ~>(%mean.'rake-hoon' (need reek)) ++ reek ^- (unit wing) ?+ gen ~ @@ -8941,7 +8941,7 @@ ^- term =+ wig=rake ?. ?=({@ ~} wig) - ~>(%mean.[%leaf "rusk-hoon"] !!) + ~>(%mean.'rusk-hoon' !!) i.wig -- :: @@ -9089,7 +9089,7 @@ %void %void %noun [%atom p.base.skin ~] [%atom *] ?. (fitz p.base.skin p.ref) - ~>(%mean.[%leaf "atom-mismatch"] !!) + ~>(%mean.'atom-mismatch' !!) :+ %atom (max p.base.skin p.ref) q.ref @@ -9134,7 +9134,7 @@ [%atom *] ?: &(?=(^ q.ref) !=(atom.skin u.q.ref)) %void ?. (fitz aura.skin p.ref) - ~>(%mean.[%leaf "atom-mismatch"] !!) + ~>(%mean.'atom-mismatch' !!) :+ %atom (max aura.skin p.ref) `atom.skin @@ -9626,14 +9626,14 @@ ++ play ^- type =+ lug=(find %read hyp) - ?: ?=(%| -.lug) ~>(%mean.[%leaf "hoon"] ?>(?=(~ rig) p.p.lug)) + ?: ?=(%| -.lug) ~>(%mean.'hoon' ?>(?=(~ rig) p.p.lug)) (elbo p.lug rig) :: ++ mint |= gol/type ^- (pair type nock) =+ lug=(find %read hyp) - ?: ?=(%| -.lug) ~>(%mean.[%leaf "hoon"] ?>(?=(~ rig) p.lug)) + ?: ?=(%| -.lug) ~>(%mean.'hoon' ?>(?=(~ rig) p.lug)) =- ?>(?|(!vet (nest(sut gol) & p.-)) -) (etco p.lug rig) :: @@ -9902,7 +9902,7 @@ :- %hold ?. ?=({$core *} p) ~_ (dunk %fire-type) - ~>(%mean.[%leaf "fire-core"] !!) + ~>(%mean.'fire-core' !!) =+ dox=[%core q.q.p q.p(r.p %gold)] ?: ?=($dry -.q) :: ~_ (dunk(sut [%cell q.q.p p.p]) %fire-dry) @@ -9934,7 +9934,7 @@ [%3 %0 axe] (flan $(sut p.sut, axe (peg axe 2)) $(sut q.sut, axe (peg axe 3))) :: - {$core *} ~>(%mean.[%leaf "fish-core"] !!) + {$core *} ~>(%mean.'fish-core' !!) {$face *} $(sut q.sut) {$fork *} =+ yed=~(tap in p.sut) |- ^- nock @@ -9942,7 +9942,7 @@ {$hint *} $(sut q.sut) {$hold *} ?: (~(has in vot) sut) - ~>(%mean.[%leaf "fish-loop"] !!) + ~>(%mean.'fish-loop' !!) => %=(. vot (~(put in vot) sut)) $(sut repo) == @@ -9980,7 +9980,7 @@ {$hint *} (hint p.sut $(sut q.sut)) {$hold *} ?: (~(has in bix) [sut ref]) - ~>(%mean.[%leaf "fuse-loop"] !!) + ~>(%mean.'fuse-loop' !!) $(sut repo, bix (~(put in bix) [sut ref])) :: $noun ref @@ -10185,7 +10185,7 @@ |^ ^- {p/type q/nock} ?: ?&(=(%void sut) !?=({$dbug *} gen)) ?. |(!vet ?=({$lost *} gen) ?=({$zpzp *} gen)) - ~>(%mean.[%leaf "mint-vain"] !!) + ~>(%mean.'mint-vain' !!) [%void %0 0] ?- gen :: @@ -10267,7 +10267,7 @@ {$wthx *} :- (nice bool) =+ fid=(find %read [[%& 1] q.gen]) - ~> %mean.[%leaf "mint-fragment"] + ~> %mean.'mint-fragment' ?> &(?=(%& -.fid) ?=(%& -.q.p.fid)) (~(fish ar `type`p.q.p.fid `skin`p.gen) (tend p.p.fid)) :: @@ -10294,7 +10294,7 @@ {$lost *} ?: vet ~_ (dunk(sut (play p.gen)) 'lost') - ~>(%mean.[%leaf "mint-lost"] !!) + ~>(%mean.'mint-lost' !!) [%void [%0 0]] :: {$zpmc *} @@ -10311,7 +10311,7 @@ =+ doz=~(open ap gen) ?: =(doz gen) ~_ (show [%c 'hoon'] [%q gen]) - ~>(%mean.[%leaf "mint-open"] !!) + ~>(%mean.'mint-open' !!) $(gen doz) == :: @@ -10349,7 +10349,7 @@ |= {gol/type dox/type gen/hoon} |^ ^- {p/type q/type} ?: =(%void sut) - ~>(%mean.[%leaf "mull-none"] !!) + ~>(%mean.'mull-none' !!) ?- gen :: {^ *} @@ -10414,9 +10414,9 @@ :- %void ?: =(%void q.fex) %void - ~>(%mean.[%leaf "if-z"] (play(sut q.fex) q.gen)) + ~>(%mean.'if-z' (play(sut q.fex) q.gen)) ?: =(%void q.fex) - ~>(%mean.[%leaf "mull-bonk-b"] !!) + ~>(%mean.'mull-bonk-b' !!) $(sut p.fex, dox q.fex, gen q.gen) =+ ^= ran ^- {p/type q/type} =+ wux=[p=(lose p.gen) q=(lose(sut dox) p.gen)] @@ -10424,9 +10424,9 @@ :- %void ?: =(%void q.wux) %void - ~>(%mean.[%leaf "if-a"] (play(sut q.wux) r.gen)) + ~>(%mean.'if-a' (play(sut q.wux) r.gen)) ?: =(%void q.wux) - ~>(%mean.[%leaf "mull-bonk-c"] !!) + ~>(%mean.'mull-bonk-c' !!) $(sut p.wux, dox q.wux, gen r.gen) [(nice (fork p.hiq p.ran ~)) (fork q.hiq q.ran ~)] :: @@ -10436,11 +10436,11 @@ q=(cove q:(mint(sut dox) %noun [%wing q.gen])) =+ pov=[p=(fish(sut p.waz) p.syx) q=(fish(sut q.waz) q.syx)] ?. &(=(p.syx q.syx) =(p.pov q.pov)) - ~>(%mean.[%leaf "mull-bonk-a"] !!) + ~>(%mean.'mull-bonk-a' !!) (beth bool) :: {$wthx *} - ~> %mean.[%leaf "mull-bonk-x"] + ~> %mean.'mull-bonk-x' =+ :- =+ (find %read [[%& 1] q.gen]) ?> &(?=(%& -.-) ?=(%& -.q.p.-)) new=[type=p.q.p.- axis=(tend p.p.-)] @@ -10456,7 +10456,7 @@ {$lost *} ?: vet :: ~_ (dunk(sut (play p.gen)) 'also') - ~>(%mean.[%leaf "mull-skip"] !!) + ~>(%mean.'mull-skip' !!) (beth %void) :: {$zpts *} (beth %noun) @@ -10468,7 +10468,7 @@ {$zpvt *} =+ [(feel p.gen) (feel(sut dox) p.gen)] ?. =(-< ->) - ~>(%mean.[%leaf "mull-bonk-f"] !!) + ~>(%mean.'mull-bonk-f' !!) ?: -< $(gen q.gen) $(gen r.gen) @@ -10478,7 +10478,7 @@ =+ doz=~(open ap gen) ?: =(doz gen) ~_ (show [%c 'hoon'] [%q gen]) - ~>(%mean.[%leaf "mull-open"] !!) + ~>(%mean.'mull-open' !!) $(gen doz) == :: @@ -10604,7 +10604,7 @@ ?. tel | :: ~_ (dunk %need) :: ~_ (dunk(sut ref) %have) - ~_ [%leaf "nest-fail"] + ~> %mean.'nest-fail' !! ?: =(sut ref) & ?- sut @@ -10774,7 +10774,8 @@ * =+ doz=~(open ap gen) ?: =(doz gen) ~_ (show [%c 'hoon'] [%q gen]) - ~>(%mean.[%leaf "play-open"] !!) + ~> %mean.'play-open' + !! $(gen doz) == :: :: @@ -11002,7 +11003,7 @@ {$hint *} q.sut {$hold *} (rest [[p.sut q.sut] ~]) $noun (fork [%atom %$ ~] [%cell %noun %noun] ~) - * ~>(%mean.[%leaf "repo-fltt"] !!) + * ~>(%mean.'repo-fltt' !!) == :: ++ rest @@ -11010,7 +11011,7 @@ |= leg/(list {p/type q/hoon}) ^- type ?: (lien leg |=({p/type q/hoon} (~(has in fan) [p q]))) - ~>(%mean.[%leaf "rest-loop"] !!) + ~>(%mean.'rest-loop' !!) => .(fan (~(gas in fan) leg)) %- fork %~ tap in @@ -14132,14 +14133,14 @@ :: :: Here's an example of what a hint looks like. :: - :: ~>(%mean.[%leaf "need"] !!) + :: ~>(%mean.'need' !!) :: :: The actual form that we're printing here looks something like this: :: - :: %mean.[%leaf "need"] + :: %mean.'need' :: - :: XX I'm not sure if the `[%leaf "need"]` bit represents a literal - :: AST fragment or an expression that evaluates to `[%leaf "need"]. I'm + :: XX I'm not sure if the `'neeed` bit represents a literal + :: AST fragment or an expression that evaluates to `'need'`. I'm :: going to assume the latter for now. :: ++ tiscol-to-plum From bbe0cb3014206cf0fb155b6f42b8ecd2d0e42ff8 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 9 Aug 2019 14:26:37 -0700 Subject: [PATCH 23/23] revert change to ben's comment --- pkg/arvo/sys/hoon.hoon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 0847c4f9b3..b7a80da517 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -14133,14 +14133,14 @@ :: :: Here's an example of what a hint looks like. :: - :: ~>(%mean.'need' !!) + :: ~>(%mean.[%leaf "need"] !!) :: :: The actual form that we're printing here looks something like this: :: - :: %mean.'need' + :: %mean.[%leaf "need"] :: - :: XX I'm not sure if the `'neeed` bit represents a literal - :: AST fragment or an expression that evaluates to `'need'`. I'm + :: XX I'm not sure if the `[%leaf "need"]` bit represents a literal + :: AST fragment or an expression that evaluates to `[%leaf "need"]`. I'm :: going to assume the latter for now. :: ++ tiscol-to-plum