Remove cubab.

This commit is contained in:
C. Guy Yarvin 2015-12-28 15:53:10 -05:00
parent 52d6c1e2b4
commit d5dd8d1321
15 changed files with 39 additions and 271 deletions

View File

@ -276,7 +276,6 @@ J_F_OFILES=\
jets/f/comb.o \
jets/f/cons.o \
jets/f/core.o \
jets/f/cube.o \
jets/f/face.o \
jets/f/fitz.o \
jets/f/flan.o \
@ -293,7 +292,6 @@ J_F_OFILES_UT=\
jets/f/ut_conk.o \
jets/f/ut_crop.o \
jets/f/ut_fire.o \
jets/f/ut_firm.o \
jets/f/ut_fish.o \
jets/f/ut_fuse.o \
jets/f/ut_gain.o \

View File

@ -1,30 +0,0 @@
/* j/6/cube.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qf_cube(u3_noun dil,
u3_noun goq)
{
if ( c3__void == goq ) {
return c3__void;
}
else return u3nt(c3__cube,
u3k(dil),
u3k(goq));
}
u3_noun
u3wf_cube(u3_noun cor)
{
u3_noun dil, goq;
if ( c3n == u3r_mean(cor, u3x_sam_2, &dil, u3x_sam_3, &goq, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_cube(dil, goq);
}
}

View File

@ -29,9 +29,6 @@
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}

View File

@ -24,7 +24,14 @@
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom: return 0;
case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( c3y == u3du(q_sut) ) {
return u3k(u3t(q_sut));
} else {
return 0;
}
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3nc
@ -39,10 +46,6 @@
(u3k(prq_sut),
_burn_in(van, p_sut, gil));
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3k(p_sut);
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return _burn_in(van, q_sut, gil);

View File

@ -117,34 +117,6 @@
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( (c3__cube == u3h(ref)) &&
(c3y == u3r_sing(p_sut, u3h(u3t(ref)))) )
{
return c3__void;
}
else if ( (c3__atom == u3h(ref)) &&
(c3y == u3du(u3t(u3t(ref)))) &&
(c3y == u3r_sing(p_sut, u3t(u3t(u3t(ref))))) )
{
return c3__void;
}
else if ( (c3__atom == u3h(ref)) ||
(c3__cell == u3h(ref)) ) {
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret;
if ( c3y == u3qfu_firm(van, foz, p_sut) ) {
ret = u3qf_cube(p_sut, foz);
}
else ret = c3__void;
u3z(foz);
return ret;
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
@ -201,9 +173,6 @@
default: return u3m_bail(c3__fail);
case c3__core:
case c3__cube: {
return u3k(sut);
}
case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref);
{
return _crop_dext(van, sut, q_ref, bix);

View File

@ -1,100 +0,0 @@
/* j/6/firm.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_firm(u3_noun van,
u3_noun sut,
u3_noun dib)
{
u3_noun p_sut, q_sut;
if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3m_bail(c3__fail);
case c3__noun:
{
return c3y;
}
case c3__void:
{
return c3n;
}
}
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3ud(dib);
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return c3a(u3du(dib),
c3a(_cqfu_firm(van, p_sut, u3h(dib)),
_cqfu_firm(van, q_sut, u3t(dib))));
}
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut;
u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut);
u3x_cell(rq_sut, &prq_sut, &qrq_sut);
return c3a(u3du(dib),
c3a(_cqfu_firm(van, p_sut, u3h(dib)),
((u3_nul == prq_sut) ? u3m_error("firm-core")
: u3r_sing(prq_sut,
u3t(dib)))));
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3r_sing(dib, p_sut);
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return _cqfu_firm(van, q_sut, dib);
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return c3o(_cqfu_firm(van, p_sut, dib),
_cqfu_firm(van, q_sut, dib));
}
case c3__hold:
{
u3_noun goy = u3qfu_repo(van, sut);
u3_noun ret = _cqfu_firm(van, goy, dib);
u3z(goy);
return ret;
}
}
}
/* boilerplate
*/
u3_noun
u3wfu_firm(u3_noun cor)
{
u3_noun sut, dib, van;
if ( (c3n == u3r_mean(cor, u3x_sam, &dib, u3x_con, &van, 0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_firm(van, sut, dib);
}
}
u3_noun
u3qfu_firm(u3_noun van,
u3_noun sut,
u3_noun dib)
{
return _cqfu_firm(van, sut, dib);
}

View File

@ -28,17 +28,20 @@
default: return u3m_bail(c3__fail);
case c3__atom: {
u3_noun ton = u3nt(3, 0, u3k(axe));
u3_noun pro = u3qf_flip(ton);
u3z(ton);
return pro;
}
case c3__bull: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _fish_in(van, q_sut, axe, vit);
if ( c3n == u3du(q_sut) ) {
u3_noun ton = u3nt(3, 0, u3k(axe));
u3_noun pro = u3qf_flip(ton);
u3z(ton);
return pro;
} else {
return u3nt(5,
u3nc(1, u3k(u3t(q_sut))),
u3nc(0, u3k(axe)));
}
}
}
case c3__cell: {
@ -66,15 +69,6 @@
case c3__core: {
return u3nc(0, 0);
}
case c3__cube: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return u3nt(5,
u3nc(1, u3k(p_sut)),
u3nc(0, u3k(axe)));
}
}
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);

View File

@ -113,19 +113,6 @@
{
return _fuse_repo(van, sut, ref, bix);
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _fuse_in(van, q_sut, ref, bix);
u3_noun ret;
if ( c3n == u3qfu_firm(van, foz, p_sut) ) {
ret = c3__void;
} else {
ret = u3qf_cube(p_sut, foz);
}
u3z(foz);
return ret;
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun vot = _fuse_in(van, q_sut, ref, bix);

View File

@ -12,8 +12,8 @@
_mint_bean()
{
return u3nt(c3__fork,
u3nt(c3__cube, 0, u3nt(c3__atom, 'f', u3_nul)),
u3nt(c3__cube, 1, u3nt(c3__atom, 'f', u3_nul)));
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
}
static u3_noun
@ -491,14 +491,10 @@
case c3__blob: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun boc = (c3n == u3ud(q_gen))
? c3__noun
: u3nt(c3__atom, u3k(p_gen), u3_nul);
u3_noun typ = u3qf_cube(q_gen, boc);
u3_noun typ = u3qfu_play(van, sut, gen);
u3_noun ret = u3nc(_mint_nice(van, gol, typ),
u3nc(1, u3k(q_gen)));
u3z(boc);
return ret;
}
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);

View File

@ -37,8 +37,8 @@
_mull_bean()
{
return u3nt(c3__fork,
u3nt(c3__cube, 0, u3nt(c3__atom, 'f', u3_nul)),
u3nt(c3__cube, 1, u3nt(c3__atom, 'f', u3_nul)));
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
}
static u3_noun
@ -458,13 +458,9 @@
case c3__blob: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun tof = u3nt(c3__cube,
u3k(q_gen),
(c3y == u3du(q_gen))
? c3__noun
: u3nt(c3__atom, u3k(p_gen), u3_nul));
u3_noun typ = u3qfu_play(van, sut, gen);
return _mull_both(van, gol, tof);
return _mull_both(van, gol, typ);
}
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();

View File

@ -212,12 +212,6 @@
}
return c3y;
}
if ( (c3y == u3r_pq(ref, c3__cube, &p_ref, &q_ref)) ) {
if ( (c3y == u3du(q_sut)) &&
(c3y == u3r_sing(u3t(q_sut), p_ref)) ) {
return c3y;
}
}
return _nest_sint(van, sut, tel, ref, gil);
}
}
@ -242,20 +236,6 @@
else return _nest_sint(van, sut, tel, ref, gil);
}
}
case c3__cube: {
if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) {
return u3m_bail(c3__fail);
} else {
if ( c3y == u3r_pq(ref, c3__cube, &p_ref, &q_ref) ) {
return u3r_sing(p_sut, p_ref);
}
else if ( (c3y == u3r_pq(ref, c3__atom, &p_ref, &q_ref)) &&
(c3y == u3du(q_ref)) ) {
return u3r_sing(p_sut, u3t(q_ref));
}
else return _nest_sint(van, sut, tel, ref, gil);
}
}
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
@ -279,7 +259,6 @@
case c3__atom:
case c3__cell:
case c3__cube:
case c3__core:
break;
}
@ -391,13 +370,6 @@
u3z(gam);
return hiv;
}
case c3__cube: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);
} else {
return _nest_dext(van, sut, tel, q_ref, gil);
}
}
case c3__face: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);

View File

@ -90,13 +90,6 @@
return pro;
}
}
case c3__cube: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _peek_in(van, q_sut, way, axe, gil);
}
}
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);

View File

@ -15,8 +15,18 @@
_play_bean()
{
return u3nt(c3__fork,
u3nt(c3__cube, 0, u3nt(c3__atom, 'f', u3_nul)),
u3nt(c3__cube, 1, u3nt(c3__atom, 'f', u3_nul)));
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
}
static u3_noun
_play_blob(u3_noun odo, u3_noun bob)
{
if ( c3y == u3ud(bob) ) {
return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob));
}
else return u3nt(c3__cell, _play_blob(odo, u3h(bob)),
_play_blob(odo, u3t(bob)));
}
static u3_noun
@ -237,13 +247,7 @@
case c3__blob: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun boc = (c3n == u3ud(q_gen))
? c3__noun
: u3nt(c3__atom, u3k(p_gen), u3_nul);
u3_noun ret = u3qf_cube(q_gen, boc);
u3z(boc);
return ret;
return _play_blob(p_gen, q_gen);
}
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();

View File

@ -32,13 +32,6 @@
return u3nt(c3__cell, c3__noun, u3k(p_sut));
}
}
case c3__cube: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);
} else {
return u3k(q_sut);
}
}
case c3__face: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);

View File

@ -335,7 +335,6 @@ static u3j_harm _mood__hoon_cell_a[] = {{".2", u3wf_cell}, {}};
static u3j_harm _mood__hoon_comb_a[] = {{".2", u3wf_comb}, {}};
static u3j_harm _mood__hoon_cons_a[] = {{".2", u3wf_cons}, {}};
static u3j_harm _mood__hoon_core_a[] = {{".2", u3wf_core}, {}};
static u3j_harm _mood__hoon_cube_a[] = {{".2", u3wf_cube}, {}};
static u3j_harm _mood__hoon_face_a[] = {{".2", u3wf_face}, {}};
static u3j_harm _mood__hoon_fitz_a[] = {{".2", u3wf_fitz}, {}};
static u3j_harm _mood__hoon_flan_a[] = {{".2", u3wf_flan}, {}};
@ -350,7 +349,6 @@ static u3j_harm _mood__hoon__ut_burn_a[] = {{".2", u3wfu_burn}, {}};
static u3j_harm _mood__hoon__ut_conk_a[] = {{".2", u3wfu_conk}, {}};
static u3j_harm _mood__hoon__ut_crop_a[] = {{".2", u3wfu_crop}, {}};
static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
static u3j_harm _mood__hoon__ut_firm_a[] = {{".2", u3wfu_firm}, {}};
static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}};
static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}};
static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}};
@ -369,7 +367,6 @@ static u3j_core _mood__hoon__ut_d[] =
{ "conk", _mood__hoon__ut_conk_a },
{ "crop", _mood__hoon__ut_crop_a },
{ "fire", _mood__hoon__ut_fire_a },
{ "firm", _mood__hoon__ut_firm_a },
{ "fish", _mood__hoon__ut_fish_a },
{ "fuse", _mood__hoon__ut_fuse_a },
{ "mint", _mood__hoon__ut_mint_a },
@ -530,7 +527,6 @@ static u3j_core _mood__hoon_d[] =
{ "comb", _mood__hoon_comb_a },
{ "cons", _mood__hoon_cons_a },
{ "core", _mood__hoon_core_a },
{ "cube", _mood__hoon_cube_a },
{ "face", _mood__hoon_face_a },
{ "fitz", _mood__hoon_fitz_a },
{ "flan", _mood__hoon_flan_a },