Skip to content

Commit

Permalink
add 'mate' jet
Browse files Browse the repository at this point in the history
  • Loading branch information
sidnym-ladrut committed Sep 4, 2023
1 parent 94d4bb0 commit 3a06580
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
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(a, b) ) {
return u3k(a);
} else {
return u3m_bail(c3__fail);
}
}
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);
}

2 changes: 2 additions & 0 deletions pkg/noun/jets/q.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
u3_noun u3qb_lien(u3_noun, u3_noun);
u3_noun u3qb_murn(u3_noun, u3_noun);
u3_noun u3qb_need(u3_noun);
u3_noun u3qb_mate(u3_noun, u3_noun);
u3_noun u3qb_reap(u3_atom, u3_noun);
u3_noun u3qb_reel(u3_noun, u3_noun);
u3_noun u3qb_roll(u3_noun, u3_noun);
Expand Down Expand Up @@ -254,3 +255,4 @@
void u3qf_test(const c3_c*, u3_noun);

#endif /* ifndef U3_JETS_Q_H */

3 changes: 3 additions & 0 deletions pkg/noun/jets/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,7 @@ static c3_c* _k140_ha[] = {

/* new jets
*/
static u3j_harm _139_two_mate_a[] = {{".2", u3wb_mate, c3y}, {}};
static u3j_harm _139_hex_json_de_a[] = {{".2", u3we_json_de}, {}};
static u3j_harm _139_hex_json_en_a[] = {{".2", u3we_json_en}, {}};
static u3j_core _139_hex_json_d[] =
Expand Down Expand Up @@ -2282,6 +2283,7 @@ static u3j_core _139_two_d[] =
{ "lien", 7, _140_two_lien_a, 0, no_hashes },
{ "murn", 7, _140_two_murn_a, 0, no_hashes },
{ "need", 7, _140_two_need_a, 0, no_hashes },
{ "mate", 7, _139_two_mate_a, 0, no_hashes },
{ "reap", 7, _140_two_reap_a, 0, no_hashes },
{ "reel", 7, _140_two_reel_a, 0, no_hashes },
{ "roll", 7, _140_two_roll_a, 0, no_hashes },
Expand Down Expand Up @@ -2438,3 +2440,4 @@ u3j_Dash = {
0,
0
};

2 changes: 2 additions & 0 deletions pkg/noun/jets/w.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
u3_noun u3wb_lien(u3_noun);
u3_noun u3wb_murn(u3_noun);
u3_noun u3wb_need(u3_noun);
u3_noun u3wb_mate(u3_noun);
u3_noun u3wb_reap(u3_noun);
u3_noun u3wb_reel(u3_noun);
u3_noun u3wb_roll(u3_noun);
Expand Down Expand Up @@ -332,3 +333,4 @@
u3_noun u3wfu_rest(u3_noun);

#endif /* ifndef U3_JETS_W_H */

0 comments on commit 3a06580

Please sign in to comment.