Now completely free of %fork. About to change over %hold.

This commit is contained in:
C. Guy Yarvin 2016-01-10 21:39:32 -08:00
parent 4f31be75db
commit 8cc712259e
14 changed files with 28 additions and 266 deletions

View File

@ -6,34 +6,6 @@
/* functions
*/
u3_noun
u3qf_fork(u3_noun hoz,
u3_noun bur)
{
if ( c3y == u3r_sing(hoz, bur) ) {
return u3k(hoz);
}
else if ( c3__void == bur ) {
return u3k(hoz);
}
else if ( c3__void == hoz ) {
return u3k(bur);
}
else return u3nt
(c3__fork, u3k(hoz), u3k(bur));
}
u3_noun
u3wf_fork(u3_noun cor)
{
u3_noun hoz, bur;
if ( c3n == u3r_mean(cor, u3x_sam_2, &hoz, u3x_sam_3, &bur, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_fork(hoz, bur);
}
}
u3_noun
u3qf_forq(u3_noun hoz,
u3_noun bur)
@ -50,35 +22,6 @@
else return u3nq
(c3__frog, u3k(hoz), u3k(bur), u3_nul);
}
u3_noun
u3wf_forq(u3_noun cor)
{
u3_noun hoz, bur;
if ( c3n == u3r_mean(cor, u3x_sam_2, &hoz, u3x_sam_3, &bur, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_forq(hoz, bur);
}
}
u3_noun
u3qf_grof(u3_noun yed)
{
if ( u3_nul == yed ) {
return c3__void;
}
else if ( u3_nul == u3t(yed) ) {
return u3k(u3h(yed));
}
else {
u3_noun nex = u3qf_grof(u3t(yed));
u3_noun ret = u3qf_fork(u3h(yed), nex);
u3z(nex);
return ret;
}
}
u3_noun
u3qf_frog(u3_noun yed)
@ -108,6 +51,18 @@
}
}
u3_noun
u3wf_frog(u3_noun cor)
{
u3_noun yed;
if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_frog(yed);
}
}
u3_noun
u3kf_frog(u3_noun yed)
{

View File

@ -32,7 +32,7 @@
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
case c3__frog: p_sut = u3t(sut);
{
}
case c3__hold: p_sut = u3t(sut);

View File

@ -50,25 +50,10 @@
{
return _burn_in(van, q_sut, gil);
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return _burn_in(van, p_sut, gil);
}
#if 0
case c3__frog: p_sut = u3t(sut);
{
return _burn_in(van, u3h(p_sut), gil);
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _burn_in(van, fag, gil);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_sut = u3t(sut);
{
if ( (c3y == u3qdi_has(gil, sut)) ) {

View File

@ -3,8 +3,6 @@
*/
#include "all.h"
#define FROG
/* logic
*/
static u3_noun
@ -35,7 +33,6 @@
}
}
#ifdef FROG
static u3_noun
_crop_dext_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
@ -61,7 +58,6 @@
return zat;
}
}
#endif
static u3_noun
_crop_dext(u3_noun van,
@ -154,33 +150,10 @@
u3z(foz);
return ret;
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun dis = _crop_dext(van, p_sut, ref, bix);
u3_noun dat = _crop_dext(van, q_sut, ref, bix);
u3_noun ret = u3qf_forq(dis, dat);
u3z(dis);
u3z(dat);
return ret;
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
return u3kf_frog(_crop_dext_frog(van, p_sut, ref, bix));
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _crop_dext(van, fag, ref, bix);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_sut = u3t(sut);
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
@ -231,21 +204,10 @@
u3z(hin);
return ret;
}
#ifdef FROG
case c3__frog: p_ref = u3t(ref);
{
return _crop_sint_frog(van, sut, p_ref, bix);
}
#else
case c3__frog: p_ref = u3t(ref);
{
u3_noun fag = u3qf_grof(p_ref);
u3_noun ret = _crop_sint(van, sut, fag, bix);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_ref = u3t(ref);
{
u3_noun rep = u3qfu_repo(van, ref);

View File

@ -3,14 +3,11 @@
*/
#include "all.h"
#define FROG
/* functions
*/
static u3_noun
_fish_in(u3_noun, u3_noun, u3_atom, u3_noun);
#ifdef FROG
static u3_noun
_fish_frog(u3_noun van,
u3_noun p_sut,
@ -31,7 +28,6 @@
return pro;
}
}
#endif
static u3_noun
_fish_in(u3_noun van,
@ -118,21 +114,10 @@
return pro;
}
}
#ifdef FROG
case c3__frog: {
p_sut = u3t(sut);
return _fish_frog(van, p_sut, axe, vit);
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _fish_in(van, fag, axe, vit);
u3z(fag);
return ret;
}
#endif
case c3__hold: {
p_sut = u3t(sut);
{

View File

@ -3,8 +3,6 @@
*/
#include "all.h"
#define FROG
/* logic
*/
static u3_noun
@ -33,7 +31,6 @@
}
}
#ifdef FROG
static u3_noun
_fuse_in_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
@ -45,7 +42,6 @@
_fuse_in_frog(van, u3t(p_sut), ref, bix));
}
}
#endif
static u3_noun
_fuse_in(u3_noun van,
@ -136,31 +132,10 @@
u3z(vot);
return ret;
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun dis = _fuse_in(van, p_sut, ref, bix);
u3_noun dat = _fuse_in(van, q_sut, ref, bix);
u3_noun ret = u3qf_fork(dis, dat);
u3z(dis);
u3z(dat);
return ret;
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
return u3kf_frog(_fuse_in_frog(van, p_sut, ref, bix));
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _fuse_in(van, fag, ref, bix);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_sut = u3t(sut);
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));

View File

@ -13,9 +13,10 @@
static u3_noun
_mint_bean()
{
return u3nt(c3__fork,
return u3nq(c3__frog,
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul);
}
static u3_noun

View File

@ -24,9 +24,10 @@
static u3_noun
_mull_bean()
{
return u3nt(c3__fork,
return u3nq(c3__frog,
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul);
}
static u3_noun

View File

@ -3,8 +3,6 @@
*/
#include "all.h"
#define FROG
/* logic
*/
/* forward
@ -255,31 +253,6 @@
return _nest_dext(van, q_sut, tel, ref, seg, reg, gil);
}
}
case c3__fork: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
}
else {
if ( c3n == u3du(ref) ) switch ( ref ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__noun:
break;
}
else switch ( u3h(ref) ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__atom:
case c3__cell:
case c3__core:
break;
}
return c3o(_nest_dext(van, p_sut, c3n, ref, seg, reg, gil),
_nest_dext(van, q_sut, c3n, ref, seg, reg, gil));
}
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
if ( c3n == u3du(ref) ) switch ( ref ) {
@ -306,16 +279,6 @@
}
return c3n;
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _nest_dext(van, fag, tel, ref, seg, reg, gil);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_sut = u3t(sut);
{
if ( c3y == u3qdi_has(seg, sut) ) {
@ -361,7 +324,7 @@
if ( (c3y == tyn) || (c3n == tel) ) {
return tyn;
} else {
#ifdef FROG
#if 0
u3_noun dun = u3qfu_dunq(van, "need", sut);
u3_noun niz = u3qfu_dunq(van, "have", ref);
@ -441,14 +404,6 @@
return _nest_dext(van, sut, tel, q_ref, seg, reg, gil);
}
}
case c3__fork: {
if ( (c3y == u3r_mean(ref, 6, &p_ref, 7, &q_ref, 0)) ) {
return c3a(_nest_dext(van, sut, tel, p_ref, seg, reg, gil),
_nest_dext(van, sut, tel, q_ref, seg, reg, gil));
}
else return u3m_bail(c3__fail);
}
#ifdef FROG
case c3__frog: {
p_ref = u3t(ref);
@ -461,16 +416,6 @@
}
return c3y;
}
#else
case c3__frog: p_ref = u3t(ref);
{
u3_noun fag = u3qf_grof(p_ref);
u3_noun ret = _nest_dext(van, sut, tel, fag, seg, reg, gil);
u3z(fag);
return ret;
}
#endif
case c3__hold: {
if ( c3y == u3qdi_has(reg, ref) ) {
return c3y;

View File

@ -3,7 +3,6 @@
*/
#include "all.h"
#define FROG
/* logic
*/
@ -13,7 +12,6 @@
static u3_noun
_peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
#ifdef FROG
static u3_noun
_peek_frog(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil)
{
@ -25,7 +23,6 @@
_peek_frog(van, u3t(p_sut), way, axe, gil));
}
}
#endif
static u3_noun
_peek_in(u3_noun van,
@ -115,37 +112,11 @@
return _peek_in(van, q_sut, way, axe, gil);
}
}
case c3__fork: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
u3_noun hed = _peek_in(van, p_sut, way, axe, gil);
u3_noun tal = _peek_in(van, q_sut, way, axe, gil);
pro = u3qf_forq(hed, tal);
u3z(hed);
u3z(tal);
return pro;
}
}
#ifdef FROG
case c3__frog: {
p_sut = u3t(sut);
return u3kf_frog(_peek_frog(van, p_sut, way, axe, gil));
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _peek_in(van, fag, way, axe, gil);
u3z(fag);
return ret;
}
#endif
case c3__hold: {
p_sut = u3t(sut);
if ( (c3y == u3qdi_has(gil, sut)) ) {

View File

@ -15,9 +15,10 @@
static u3_noun
_play_bean()
{
return u3nt(c3__fork,
return u3nq(c3__frog,
u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1));
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul);
}
static u3_noun

View File

@ -16,9 +16,10 @@
default: return u3k(sut);
case c3__noun:
return u3nt(c3__fork,
return u3nq(c3__frog,
u3nt(c3__atom, u3_blip, u3_nul),
u3nt(c3__cell, c3__noun, c3__noun));
u3nt(c3__cell, c3__noun, c3__noun),
u3_nul);
}
else switch ( u3h(sut) ) {
default: {

View File

@ -3,11 +3,8 @@
*/
#include "all.h"
#define FROG
static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun);
#ifdef FROG
static u3_noun
_wrap_frog(u3_noun van, u3_noun p_sut, u3_noun yoz)
{
@ -19,7 +16,6 @@
_wrap_frog(van, u3t(p_sut), yoz));
}
}
#endif
static u3_noun
_cqfu_wrap(u3_noun van,
@ -52,26 +48,10 @@
u3k(rq_sut)));
}
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3qf_forq(_cqfu_wrap(van, p_sut, yoz),
_cqfu_wrap(van, q_sut, yoz));
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
return u3kf_frog(_wrap_frog(van, p_sut, yoz));
}
#else
case c3__frog: p_sut = u3t(sut);
{
u3_noun fag = u3qf_grof(p_sut);
u3_noun ret = _cqfu_wrap(van, fag, yoz);
u3z(fag);
return ret;
}
#endif
case c3__hold:
{
u3_noun fop = u3qfu_repo(van, sut);

View File

@ -340,7 +340,7 @@ static u3j_harm _mood__hoon_fitz_a[] = {{".2", u3wf_fitz}, {}};
static u3j_harm _mood__hoon_flan_a[] = {{".2", u3wf_flan}, {}};
static u3j_harm _mood__hoon_flip_a[] = {{".2", u3wf_flip}, {}};
static u3j_harm _mood__hoon_flor_a[] = {{".2", u3wf_flor}, {}};
static u3j_harm _mood__hoon_fork_a[] = {{".2", u3wf_fork}, {}};
// static u3j_harm _mood__hoon_fork_a[] = {{".2", u3wf_fork}, {}};
static u3j_harm _mood__hoon_hike_a[] = {{".2", u3wf_hike}, {}};
static u3j_harm _mood__hoon_look_a[] = {{".2", u3wf_look}, {}};
@ -531,7 +531,7 @@ static u3j_core _mood__hoon_d[] =
{ "flan", _mood__hoon_flan_a },
{ "flip", _mood__hoon_flip_a },
{ "flor", _mood__hoon_flor_a },
{ "fork", _mood__hoon_fork_a },
// { "fork", _mood__hoon_fork_a },
{ "hike", _mood__hoon_hike_a },
{ "look", _mood__hoon_look_a },