Skip to content

Commit

Permalink
hoon: 138k (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkova authored Oct 6, 2023
2 parents b3df771 + 3ca5720 commit 5f372c8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
6 changes: 2 additions & 4 deletions pkg/noun/jets/d/by_bif.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ _b_bif_putroot(u3_noun a,
else {
u3_noun n_a, l_a, r_a;
u3_noun p_n_a, q_n_a;
u3_noun p_b, q_b;
u3x_trel(a, &n_a, &l_a, &r_a);
u3x_cell(b, &p_b, &q_b);
u3x_cell(n_a, &p_n_a, &q_n_a);

if ( c3y == u3r_sing(p_b, p_n_a) ) {
if ( c3y == u3r_sing(b, p_n_a) ) {
return u3nt(u3k(b), u3k(l_a), u3k(r_a));
}
else {
u3_noun c, n_c, l_c, r_c;
u3_noun d;

if ( c3y == u3qc_gor(p_b, p_n_a) ) {
if ( c3y == u3qc_gor(b, p_n_a) ) {
c = _b_bif_putroot(l_a, b);
u3r_trel(c, &n_c, &l_c, &r_c);
d = u3nt(u3k(n_c),
Expand Down
5 changes: 3 additions & 2 deletions pkg/noun/jets/d/by_dif.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ u3qdb_dif(u3_noun a,
return u3k(a);
}
else {
u3_noun n_b, l_b, r_b;
u3_noun n_b, p_n_b, q_n_b, l_b, r_b;
u3_noun c, l_c, r_c;
u3x_trel(b, &n_b, &l_b, &r_b);
u3x_cell(n_b, &p_n_b, &q_n_b);

c = u3qdb_bif(a, n_b);
c = u3qdb_bif(a, p_n_b);
u3x_cell(c, &l_c, &r_c);

u3_noun d = u3qdb_dif(l_c, l_b);
Expand Down
22 changes: 16 additions & 6 deletions pkg/noun/jets/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1825,11 +1825,15 @@ static c3_c* _140_two__in_ha[] = {
"1f0a6f8b945b243520b77069060589938d9e651e34b24924db9528d02a98014f",
0
};
static u3j_harm _140_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}};
static c3_c* _140_two__by_bif_ha[] = {
"d377a032a3866e76f6f5217c7c0ed0519b768d8b1c5107e35f7dbf18d8f60880",
0
};

// disabled for all due sharing, interface changed in hoon %138
//
// static u3j_harm _140_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}};
// static c3_c* _140_two__by_bif_ha[] = {
// "d377a032a3866e76f6f5217c7c0ed0519b768d8b1c5107e35f7dbf18d8f60880",
// 0
// };

static u3j_harm _140_two__by_del_a[] = {{".2", u3wdb_del, c3y}, {}};
static c3_c* _140_two__by_del_ha[] = {
"09f78d6235d3fce8303c7bc663988349b7d4592abdacfb09b833d2f43629b6b6",
Expand Down Expand Up @@ -1909,7 +1913,7 @@ static u3j_core _140_two__by_d[] =
{ { "all", 7, _140_two__by_all_a, 0, _140_two__by_all_ha },
{ "any", 7, _140_two__by_any_a, 0, _140_two__by_any_ha },
{ "apt", 7, _140_two__by_apt_a, 0, _140_two__by_apt_ha },
{ "bif", 7, _140_two__by_bif_a, 0, _140_two__by_bif_ha },
// { "bif", 7, _140_two__by_bif_a, 0, _140_two__by_bif_ha },
{ "del", 7, _140_two__by_del_a, 0, _140_two__by_del_ha },
{ "dif", 7, _140_two__by_dif_a, 0, _140_two__by_dif_ha },
{ "gas", 7, _140_two__by_gas_a, 0, _140_two__by_gas_ha },
Expand Down Expand Up @@ -2359,6 +2363,11 @@ u3j_core _k139_d[] =
{}
};

u3j_core _k138_d[] =
{ { "one", 3, 0, _139_one_d, no_hashes },
{}
};


// TODO: probably need different ha hashes

Expand Down Expand Up @@ -2428,6 +2437,7 @@ u3j_core _a50_d[] =
static u3j_core _d[] =
{ { "k140", 0, 0, _k140_d, _k140_ha, 0, (u3j_core*) 140, 0 },
{ "k139", 0, 0, _k139_d, no_hashes, 0, (u3j_core*) 139, 0 },
{ "k138", 0, 0, _k138_d, no_hashes, 0, (u3j_core*) 138, 0 },
{ "a50", 0, 0, _a50_d, _k140_ha, 0, (u3j_core*) c3__a50, 0 },
{}
};
Expand Down
2 changes: 1 addition & 1 deletion pkg/vere/pier.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ _pier_wyrd_card(u3_pier* pir_u)
u3_noun kel = u3nl(u3nc(c3__zuse, VERE_ZUSE), // XX from both king and serf?
u3nc(c3__lull, VERE_LULL), // XX from both king and serf?
u3nc(c3__arvo, 236), // XX from both king and serf?
u3nc(c3__hoon, 139), // god_u->hon_y
u3nc(c3__hoon, 138), // god_u->hon_y
u3nc(c3__nock, 4), // god_u->noc_y
u3_none);
u3_noun wir = u3nc(c3__arvo, u3_nul);
Expand Down

0 comments on commit 5f372c8

Please sign in to comment.