Initial draft of modern fishing.

This commit is contained in:
Curtis Yarvin 2018-07-09 15:37:27 -07:00
parent e820f2b995
commit 7a48d012f6
6 changed files with 160 additions and 0 deletions

View File

@ -214,6 +214,8 @@
u3_noun u3qfl_bunt(u3_noun, u3_noun); u3_noun u3qfl_bunt(u3_noun, u3_noun);
u3_noun u3qfl_whip(u3_noun, u3_noun, u3_noun); u3_noun u3qfl_whip(u3_noun, u3_noun, u3_noun);
u3_noun u3qfr_fish(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfp_hack(u3_noun, u3_noun); u3_noun u3qfp_hack(u3_noun, u3_noun);
u3_noun u3qfp_late(u3_noun); u3_noun u3qfp_late(u3_noun);
u3_noun u3qfp_open(u3_noun, u3_noun, u3_noun); u3_noun u3qfp_open(u3_noun, u3_noun, u3_noun);
@ -238,6 +240,7 @@
u3_noun u3qfu_dunq(u3_noun, const c3_c*, u3_noun); u3_noun u3qfu_dunq(u3_noun, const c3_c*, u3_noun);
void u3qfu_dump(u3_noun, const c3_c*, u3_noun); void u3qfu_dump(u3_noun, const c3_c*, u3_noun);
u3_noun u3qfu_fond(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fond(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_find(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_fire(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fire(u3_noun, u3_noun, u3_noun);
@ -292,6 +295,8 @@
u3_noun u3qzl_bunt(u3_noun, u3_noun); u3_noun u3qzl_bunt(u3_noun, u3_noun);
u3_noun u3qzl_whip(u3_noun, u3_noun, u3_noun); u3_noun u3qzl_whip(u3_noun, u3_noun, u3_noun);
u3_noun u3qzr_fish(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qzp_hack(u3_noun, u3_noun); u3_noun u3qzp_hack(u3_noun, u3_noun);
u3_noun u3qzp_late(u3_noun); u3_noun u3qzp_late(u3_noun);
u3_noun u3qzp_open(u3_noun, u3_noun, u3_noun); u3_noun u3qzp_open(u3_noun, u3_noun, u3_noun);
@ -317,6 +322,7 @@
u3_noun u3qzu_dunq(u3_noun, const c3_c*, u3_noun); u3_noun u3qzu_dunq(u3_noun, const c3_c*, u3_noun);
void u3qzu_dump(u3_noun, const c3_c*, u3_noun); void u3qzu_dump(u3_noun, const c3_c*, u3_noun);
u3_noun u3qzu_fond(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qzu_fond(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qzu_find(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qzu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qzu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qzu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qzu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qzu_fire(u3_noun, u3_noun, u3_noun); u3_noun u3qzu_fire(u3_noun, u3_noun, u3_noun);

View File

@ -997,6 +997,29 @@
return u3i_molt(gat, u3x_sam, u3k(gen), 0); return u3i_molt(gat, u3x_sam, u3k(gen), 0);
} }
static u3_noun
_ar_core(u3_noun van,
u3_noun ref,
u3_noun syn)
{
u3_noun gat = u3j_hook(u3k(van), "ar");
return u3i_molt(gat, u3x_sam, u3nc(u3k(ref), u3k(syn)), 0);
}
/* fish
*/
u3_noun
u3qfr_fish(u3_noun van,
u3_noun ref,
u3_noun syn,
u3_noun axe)
{
u3_noun gat = u3j_soft(_ar_core(van, ref, syn), "fish");
return u3n_slam_on(gat, u3k(axe));
}
/* open /* open
*/ */
static u3_noun static u3_noun

View File

@ -10,6 +10,9 @@
u3qf_flan(u3_noun bos, u3qf_flan(u3_noun bos,
u3_noun nif) u3_noun nif)
{ {
if ( c3y == u3r_sing(bos, nif) ) {
return u3k(bos);
}
if ( c3y == u3r_sing(1, u3h(bos)) ) { if ( c3y == u3r_sing(1, u3h(bos)) ) {
if ( (u3_nul == u3t(bos)) ) { if ( (u3_nul == u3t(bos)) ) {
return u3k(nif); return u3k(nif);

View File

@ -10,6 +10,9 @@
u3qf_flor(u3_noun bos, u3qf_flor(u3_noun bos,
u3_noun nif) u3_noun nif)
{ {
if ( c3y == u3r_sing(bos, nif) ) {
return u3k(bos);
}
if ( c3y == u3r_sing(1, u3h(bos)) ) { if ( c3y == u3r_sing(1, u3h(bos)) ) {
if ( (u3_nul == u3t(bos)) ) { if ( (u3_nul == u3t(bos)) ) {
return u3k(bos); return u3k(bos);

View File

@ -16,6 +16,25 @@
u3_nul)); u3_nul));
} }
static u3_noun
_mint_tend(u3_noun vit)
{
if ( u3_nul == vit ) {
return 1;
} else {
u3_noun nex = _mint_tend(u3t(vit));
if ( u3_nul == u3h(vit) ) {
return nex;
} else {
u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex);
u3z(nex);
return boy;
}
}
}
static u3_noun static u3_noun
_mint_vet(u3_noun van) _mint_vet(u3_noun van)
{ {
@ -690,6 +709,39 @@
return ret; return ret;
} }
case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen));
u3_noun fid = u3qfu_find(van, sut, c3__free, hyp);
if ( c3y != u3h(fid) ) {
return u3m_error("mint-fragment");
}
else {
u3_noun pp_fid = u3h(u3t(fid));
u3_noun qp_fid = u3t(u3t(fid));
if ( c3y != u3h(qp_fid) ) {
return u3m_error("mint-fragment");
}
else {
u3_noun pqp_fid = u3t(qp_fid);
u3_noun axe = _mint_tend(pp_fid);
u3_noun ret;
ret = u3nc(_mint_nice(van, gol, _mint_bean()),
u3qfr_fish(van, pqp_fid, p_gen, axe));
u3z(axe);
u3z(fid);
u3z(hyp);
return ret;
}
}
}
case c3__cold: case c3__cold:
case c3__ktsg: p_gen = u3t(gen); case c3__ktsg: p_gen = u3t(gen);
_mint_used(); _mint_used();

View File

@ -44,6 +44,24 @@
0)); 0));
} }
static u3_noun
_mull_tend(u3_noun vit)
{
if ( u3_nul == vit ) {
return 1;
} else {
u3_noun nex = _mull_tend(u3t(vit));
if ( u3_nul == u3h(vit) ) {
return nex;
} else {
u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex);
u3z(nex);
return boy;
}
}
}
static u3_noun static u3_noun
_mull_coke(u3_noun nug) _mull_coke(u3_noun nug)
{ {
@ -338,6 +356,61 @@
return _mull_both(van, gol, _mull_bean()); return _mull_both(van, gol, _mull_bean());
} }
case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen));
u3_noun fid = u3qfu_find(van, sut, c3__free, hyp);
u3_noun gax = u3qfu_find(van, dox, c3__free, hyp);
u3_noun old_type, old_axis;
u3_noun new_type, new_axis;
{
if ( c3y != u3h(fid) ) {
return u3m_error("mull-bonk-x");
}
else {
u3_noun pp_fid = u3h(u3t(fid));
u3_noun qp_fid = u3t(u3t(fid));
if ( c3y != u3h(qp_fid) ) {
return u3m_error("mull-bonk-x");
}
new_type = u3t(qp_fid);
new_axis = _mull_tend(pp_fid);
}
}
{
if ( c3y != u3h(gax) ) {
return u3m_error("mull-bonk-x");
}
else {
u3_noun pp_gax = u3h(u3t(gax));
u3_noun qp_gax = u3t(u3t(gax));
if ( c3y != u3h(qp_gax) ) {
return u3m_error("mull-bonk-x");
}
old_type = u3t(qp_gax);
old_axis = _mull_tend(pp_gax);
}
}
if ( c3n == u3r_sing(old_axis, new_axis) ) {
return u3m_error("mull-bonk-x");
}
else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) {
return u3m_error("mull-bonk-x");
}
u3z(old_axis);
u3z(new_axis);
u3z(gax);
u3z(fid);
return _mull_both(van, gol, _mull_bean());
}
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mull_used(); _mull_used();
{ {