Skip to content

Commit

Permalink
Merge next/kelvin/411 to develop (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkova authored Jan 3, 2024
2 parents 23fc740 + a250df7 commit 17541a7
Show file tree
Hide file tree
Showing 17 changed files with 1,100 additions and 1,404 deletions.
2 changes: 2 additions & 0 deletions pkg/c3/motes.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@
# define c3__sard c3_s4('s','a','r','d')
# define c3__sav c3_s3('s','a','v')
# define c3__save c3_s4('s','a','v','e')
# define c3__saxo c3_s4('s','a','x','o')
# define c3__scam c3_s4('s','c','a','m')
# define c3__scan c3_s4('s','c','a','n')
# define c3__scry c3_s4('s','c','r','y')
Expand Down Expand Up @@ -1112,6 +1113,7 @@
# define c3__ston c3_s4('s','t','o','n')
# define c3__stop c3_s4('s','t','o','p')
# define c3__stub c3_s4('s','t','u','b')
# define c3__stun c3_s4('s','t','u','n')
# define c3__stur c3_s4('s','t','u','r')
# define c3__sub c3_s3('s','u','b')
# define c3__sunt c3_s4('s','u','n','t')
Expand Down
30 changes: 30 additions & 0 deletions pkg/noun/jets/b/mate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/// @file

#include "jets/q.h"
#include "jets/w.h"

#include "noun.h"


u3_noun
u3qb_mate(u3_noun a,
u3_noun b)
{
if ( u3_nul == b ) {
return u3k(a);
} else if ( u3_nul == a ) {
return u3k(b);
} else if ( c3y == u3r_sing(u3t(a), u3t(b)) ) {
return u3k(a);
} else {
return u3m_error("mate");
}
}
u3_noun
u3wb_mate(u3_noun cor)
{
u3_noun a, b;
u3x_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0);
return u3qb_mate(a, b);
}

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
Loading

0 comments on commit 17541a7

Please sign in to comment.