mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
Remove all traces of snap. Add ktdt for grooming.
This commit is contained in:
parent
6faa9c453a
commit
0d63125b14
1
Makefile
1
Makefile
@ -216,7 +216,6 @@ J191_6_OFILES_UT=\
|
||||
gen191/6/ut_repo.o \
|
||||
gen191/6/ut_rest.o \
|
||||
gen191/6/ut_seek.o \
|
||||
gen191/6/ut_snap.o \
|
||||
gen191/6/ut_swab.o \
|
||||
gen191/6/ut_tack.o \
|
||||
gen191/6/ut_tock.o \
|
||||
|
@ -147,7 +147,6 @@
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, play)[];
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, rest)[];
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, seek)[];
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, snap)[];
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, tack)[];
|
||||
extern u2_ho_jet j2_mcj(Pt6, ut, tock)[];
|
||||
|
||||
@ -175,7 +174,6 @@
|
||||
{ j2_sc(Pt6, ut, play), j2_mcj(Pt6, ut, play), 0, 0, u2_none },
|
||||
{ j2_sc(Pt6, ut, rest), j2_mcj(Pt6, ut, rest), 0, 0, u2_none },
|
||||
{ j2_sc(Pt6, ut, seek), j2_mcj(Pt6, ut, seek), 0, 0, u2_none },
|
||||
{ j2_sc(Pt6, ut, snap), j2_mcj(Pt6, ut, snap), 0, 0, u2_none },
|
||||
{ j2_sc(Pt6, ut, tack), j2_mcj(Pt6, ut, tack), 0, 0, u2_none },
|
||||
{ j2_sc(Pt6, ut, tock), j2_mcj(Pt6, ut, tock), 0, 0, u2_none },
|
||||
{ }
|
||||
|
@ -551,17 +551,6 @@
|
||||
|
||||
return ret;
|
||||
}
|
||||
case c3__ktdt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
|
||||
_mint_used(wir_r);
|
||||
{
|
||||
u2_noun wit = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
|
||||
u2_noun nep = j2_mcy(Pt6, ut, snap)(wir_r, van, wit, q_gen);
|
||||
u2_noun ret = _mint_in(wir_r, van, sut, gol, nep);
|
||||
|
||||
u2_rz(wir_r, nep);
|
||||
u2_rz(wir_r, wit);
|
||||
return ret;
|
||||
}
|
||||
case c3__ktbr: p_gen = u2_t(gen);
|
||||
_mint_used(wir_r);
|
||||
{
|
||||
|
@ -502,31 +502,6 @@
|
||||
u2_noun typ = j2_mcy(Pt6, ut, play)(wir_r, van, sut, gen);
|
||||
return _mull_both(wir_r, van, gol, typ);
|
||||
}
|
||||
case c3__ktdt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
|
||||
_mull_used(wir_r);
|
||||
{
|
||||
u2_noun p_wiv = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
|
||||
u2_noun q_wiv = j2_mcy(Pt6, ut, play)(wir_r, van, dox, p_gen);
|
||||
u2_noun p_hef = j2_mcy(Pt6, ut, snap)(wir_r, van, p_wiv, q_gen);
|
||||
u2_noun q_hef = j2_mcy(Pt6, ut, snap)(wir_r, van, q_wiv, q_gen);
|
||||
u2_noun ret;
|
||||
|
||||
if ( u2_yes == u2_sing(p_hef, q_hef) ) {
|
||||
ret = _mull_in(wir_r, van, sut, gol, dox, p_hef);
|
||||
} else {
|
||||
u2_noun zyn = _mull_in(wir_r, van, sut, gol, dox, p_hef);
|
||||
|
||||
ret = u2_bc(wir_r, u2_rx(wir_r, u2_h(zyn)),
|
||||
j2_mcy(Pt6, ut, play)(wir_r, van, dox, q_hef));
|
||||
u2_rz(wir_r, zyn);
|
||||
}
|
||||
u2_rz(wir_r, q_hef);
|
||||
u2_rz(wir_r, p_hef);
|
||||
u2_rz(wir_r, q_wiv);
|
||||
u2_rz(wir_r, p_wiv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
case c3__ktbr: p_gen = u2_t(gen);
|
||||
_mull_used(wir_r);
|
||||
{
|
||||
|
@ -321,17 +321,6 @@
|
||||
u2_rz(wir_r, boc);
|
||||
return ret;
|
||||
}
|
||||
case c3__ktdt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
|
||||
_play_used(wir_r);
|
||||
{
|
||||
u2_noun boc = _play_x(wir_r, van, sut, p_gen);
|
||||
u2_noun hef = j2_mcy(Pt6, ut, snap)(wir_r, van, boc, q_gen);
|
||||
u2_noun ret = _play_x(wir_r, van, sut, hef);
|
||||
|
||||
u2_rz(wir_r, boc);
|
||||
u2_rz(wir_r, hef);
|
||||
return ret;
|
||||
}
|
||||
case c3__ktsg: p_gen = u2_t(gen);
|
||||
_play_used(wir_r);
|
||||
{
|
||||
|
@ -1,179 +0,0 @@
|
||||
/* j/6/snap.c
|
||||
**
|
||||
** This file is in the public domain.
|
||||
*/
|
||||
#include "all.h"
|
||||
#include "../pit.h"
|
||||
|
||||
/* logic
|
||||
*/
|
||||
u2_noun // transfer
|
||||
j2_mcx(Pt6, ut, snap)(u2_wire wir_r,
|
||||
u2_noun van, // retain
|
||||
u2_noun sut, // retain
|
||||
u2_noun gen) // retain
|
||||
{
|
||||
u2_noun p_sut, q_sut;
|
||||
u2_noun ret;
|
||||
|
||||
if ( u2_no == u2_dust(sut) ) {
|
||||
return u2_rx(wir_r, gen);
|
||||
}
|
||||
else switch ( u2_h(sut) ) {
|
||||
default: return u2_rx(wir_r, gen);
|
||||
|
||||
case c3__cell: {
|
||||
if ( (u2_no == u2_as_cell(u2_t(sut), &p_sut, &q_sut)) ) {
|
||||
return u2_bl_bail(wir_r, c3__fail);
|
||||
}
|
||||
else {
|
||||
u2_noun ter = u2_frag(u2_cv_con_3, van);
|
||||
u2_noun haq = j2_mcy(Pt6, ap, hack)(wir_r, ter, gen);
|
||||
|
||||
if ( u2_yes == u2_h(haq) ) {
|
||||
u2_noun p_haq, q_haq;
|
||||
|
||||
u2_as_cell(u2_t(haq), &p_haq, &q_haq);
|
||||
|
||||
ret = u2_bc
|
||||
(wir_r, j2_mcx(Pt6, ut, snap)(wir_r, van, p_sut, p_haq),
|
||||
j2_mcx(Pt6, ut, snap)(wir_r, van, q_sut, q_haq));
|
||||
} else {
|
||||
ret = u2_rx(wir_r, u2_t(haq));
|
||||
}
|
||||
u2_rl_lose(wir_r, haq);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
case c3__face: {
|
||||
if ( (u2_no == u2_as_cell(u2_t(sut), &p_sut, &q_sut)) ) {
|
||||
return u2_bl_bail(wir_r, c3__fail);
|
||||
}
|
||||
else {
|
||||
return u2_bt
|
||||
(wir_r, c3__ktts,
|
||||
u2_rx(wir_r, p_sut),
|
||||
j2_mcx(Pt6, ut, snap)(wir_r, van, q_sut, gen));
|
||||
}
|
||||
}
|
||||
case c3__fork: {
|
||||
u2_noun ter = u2_frag(u2_cv_con_3, van);
|
||||
u2_noun haq = j2_mcy(Pt6, ap, hack)(wir_r, ter, gen);
|
||||
|
||||
if ( u2_yes == u2_h(haq) ) {
|
||||
u2_noun p_haq, q_haq;
|
||||
u2_noun hed = j2_mcy(Pt6, ut, peek)(wir_r, van, sut, c3__read, 2);
|
||||
u2_noun tal = j2_mcy(Pt6, ut, peek)(wir_r, van, sut, c3__read, 3);
|
||||
|
||||
u2_as_cell(u2_t(haq), &p_haq, &q_haq);
|
||||
|
||||
ret = u2_bc
|
||||
(wir_r, j2_mcx(Pt6, ut, snap)(wir_r, van, hed, p_haq),
|
||||
j2_mcx(Pt6, ut, snap)(wir_r, van, tal, q_haq));
|
||||
|
||||
u2_rz(wir_r, hed);
|
||||
u2_rz(wir_r, tal);
|
||||
} else {
|
||||
ret = u2_rx(wir_r, u2_t(haq));
|
||||
}
|
||||
u2_rl_lose(wir_r, haq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
case c3__fine:
|
||||
case c3__cube:
|
||||
case c3__hold: {
|
||||
p_sut = u2_t(sut);
|
||||
{
|
||||
u2_noun fop = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
|
||||
|
||||
ret = j2_mcx(Pt6, ut, snap)(wir_r, van, fop, gen);
|
||||
u2_rl_lose(wir_r, fop);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* boilerplate
|
||||
*/
|
||||
u2_ho_jet
|
||||
j2_mcj(Pt6, ut, snap)[];
|
||||
|
||||
u2_noun // transfer
|
||||
j2_mc(Pt6, ut, snap)(u2_wire wir_r,
|
||||
u2_noun cor) // retain
|
||||
{
|
||||
u2_noun van, sut, gen;
|
||||
|
||||
if ( (u2_no == u2_mean(cor, u2_cv_sam, &gen, u2_cv_con, &van, 0)) ||
|
||||
(u2_none == (sut = u2_frag(u2_cv_sam, van))) )
|
||||
{
|
||||
return u2_bl_bail(wir_r, c3__fail);
|
||||
} else {
|
||||
return j2_mcx(Pt6, ut, snap)(wir_r, van, sut, gen);
|
||||
}
|
||||
}
|
||||
|
||||
u2_weak // transfer
|
||||
j2_mci(Pt6, ut, snap)(u2_wire wir_r,
|
||||
u2_noun van, // retain
|
||||
u2_noun sut, // retain
|
||||
u2_noun gen) // retain
|
||||
{
|
||||
u2_weak hoc = u2_ds_look(wir_r, van, "snap");
|
||||
|
||||
if ( u2_none == hoc ) {
|
||||
c3_assert(!"register snap");
|
||||
return u2_none;
|
||||
} else {
|
||||
u2_weak von = u2_rl_molt(wir_r, van, u2_cv_sam, u2_rx(wir_r, sut), 0);
|
||||
u2_weak gat = u2_nk_soft(wir_r, von, hoc);
|
||||
u2_weak cor = u2_rl_molt(wir_r, gat, u2_cv_sam, u2_rx(wir_r, gen), 0);
|
||||
|
||||
if ( (u2_none == j2_mcj(Pt6, ut, snap)[0].xip) ) {
|
||||
u2_noun xip = u2_ds_find(wir_r, cor);
|
||||
|
||||
c3_assert(u2_none != xip);
|
||||
j2_mcj(Pt6, ut, snap)[0].xip = xip;
|
||||
}
|
||||
u2_rl_lose(wir_r, gat);
|
||||
return cor;
|
||||
}
|
||||
}
|
||||
|
||||
u2_noun // transfer
|
||||
j2_mcy(Pt6, ut, snap)(u2_wire wir_r,
|
||||
u2_noun van, // retain
|
||||
u2_noun sut, // retain
|
||||
u2_noun gen) // retain
|
||||
{
|
||||
u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, snap)[0];
|
||||
|
||||
if ( jet_j->sat_s == u2_jet_live ) {
|
||||
return j2_mcx(Pt6, ut, snap)(wir_r, van, sut, gen);
|
||||
}
|
||||
else {
|
||||
u2_noun cor, fol, pro;
|
||||
|
||||
cor = j2_mci(Pt6, ut, snap)(wir_r, van, sut, gen);
|
||||
fol = u2_h(cor);
|
||||
|
||||
pro = u2_ho_use(wir_r, jet_j, cor, fol);
|
||||
if ( u2_none == pro ) return u2_bl_bail(wir_r, c3__fail);
|
||||
|
||||
u2_rz(wir_r, cor);
|
||||
u2_rz(wir_r, fol);
|
||||
|
||||
return pro;
|
||||
}
|
||||
}
|
||||
|
||||
/* structures
|
||||
*/
|
||||
u2_ho_jet
|
||||
j2_mcj(Pt6, ut, snap)[] = {
|
||||
{ ".2", c3__hevy, j2_mc(Pt6, ut, snap), Tier6_b, u2_none, u2_none },
|
||||
{ }
|
||||
};
|
@ -596,12 +596,6 @@
|
||||
u2_noun way,
|
||||
u2_noun hep); // retain
|
||||
|
||||
u2_noun // transfer
|
||||
j2_mcy(Pt6, ut, snap)(u2_wire wir_r,
|
||||
u2_noun van, // retain
|
||||
u2_noun sut, // retain
|
||||
u2_noun gen); // retain
|
||||
|
||||
u2_noun // transfer
|
||||
j2_mcy(Pt6, ut, tack)(u2_wire wir_r,
|
||||
u2_noun van, // retain
|
||||
|
Loading…
Reference in New Issue
Block a user