Various fixes and improvements.

This commit is contained in:
C. Guy Yarvin 2014-01-03 23:28:16 -08:00
parent b5eacfa6b9
commit a259e04a28
6 changed files with 74 additions and 3 deletions

View File

@ -50,3 +50,25 @@ j2_mcy(Pt6, al, bunt)(u2_wire wir_r,
return pro;
}
}
/* ~(whip al gen)
*/
u2_noun // transfer
j2_mcy(Pt6, al, whip)(u2_wire wir_r,
u2_noun van, // retain
u2_noun gen, // retain
u2_noun axe) //
{
u2_noun cor = _al_core(wir_r, van, gen);
u2_weak hoc = u2_ds_look(wir_r, cor, "whip");
if ( u2_none == hoc ) {
return u2_cm_bail(c3__fail);
} else {
u2_noun gat = u2_nk_soft(wir_r, cor, hoc);
u2_noun pro = u2_nk_mong(wir_r, gat, u2k(axe));
u2_rz(wir_r, hoc);
return pro;
}
}

View File

@ -402,6 +402,20 @@
return ret;
}
case c3__bcpt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_mint_used(wir_r);
{
u2_noun sep = j2_mcy(Pt6, ut, seep)(wir_r, van, sut, c3__read, p_gen);
u2_noun axe = u2h(sep);
u2_noun rex = j2_mcy(Pt6, al, whip)(wir_r, van, q_sut, axe);
u2_noun ret = _mint_in(wir_r, van, sut, gol, rex);
u2z(sep);
u2z(rex);
return ret;
}
case c3__wtts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_mint_used(wir_r);
{

View File

@ -350,6 +350,28 @@
return ret;
}
case c3__bcpt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_mint_used(wir_r);
{
u2_noun sep = j2_mcy(Pt6, ut, seep)(wir_r, van, sut, c3__read, p_gen);
u2_noun pox = j2_mcy(Pt6, ut, seep)(wir_r, van, dox, c3__read, p_gen);
u2_noun axe = u2h(sep);
if ( axe != u2h(pox) ) {
return u2_bl_error(wir_r, "mull-bonk-wing");
}
else {
u2_noun rex = j2_mcy(Pt6, al, whip)(wir_r, van, q_sut, axe);
u2_noun ret = _mull_in(wir_r, van, sut, gol, dox, rex);
u2z(sep);
u2z(pox);
u2z(rex);
return ret;
}
}
case c3__wtts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_mull_used(wir_r);
{

View File

@ -196,7 +196,20 @@
}
else switch ( u2_h(gen) ) {
default: goto open;
case c3__bcpt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_play_used(wir_r);
{
u2_noun sep = j2_mcy(Pt6, ut, seep)(wir_r, van, sut, c3__read, p_gen);
u2_noun axe = u2h(sep);
u2_noun rex = j2_mcy(Pt6, al, whip)(wir_r, van, q_sut, axe);
u2_noun ret = _play_x(wir_r, van, sut, rex);
u2z(sep);
u2z(rex);
return ret;
}
case c3__wtts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
_play_used(wir_r);
{

View File

@ -1,4 +1,4 @@
/* include/wire.h
* include/wire.h
**
** This file is in the public domain.
*/

View File

@ -600,7 +600,7 @@ _lo_lame(u2_reck* rec_u, u2_noun ovo, u2_noun why, u2_noun tan)
{
c3_c* oik_c = u2_cr_string(u2h(u2t(ovo)));
uL(fprintf(uH, "lame: %s\n", oik_c));
// uL(fprintf(uH, "lame: %s\n", oik_c));
free(oik_c);
}
#endif