Jets use grof. Now ready to apply froqs piecemeal.

This commit is contained in:
C. Guy Yarvin 2016-01-10 19:56:53 -08:00
parent b86fb544da
commit 17e1196eb4
10 changed files with 131 additions and 4 deletions

View File

@ -172,7 +172,9 @@
u3_noun u3qf_flip(u3_noun);
u3_noun u3qf_flor(u3_noun, u3_noun);
u3_noun u3qf_fork(u3_noun, u3_noun);
u3_noun u3qf_forq(u3_noun, u3_noun);
u3_noun u3qf_frog(u3_noun);
u3_noun u3qf_grof(u3_noun);
u3_noun u3qf_hike(u3_noun, u3_noun);
u3_noun u3qf_look(u3_noun, u3_noun);
u3_noun u3qf_slot(u3_atom, u3_noun);

View File

@ -62,6 +62,24 @@
}
}
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)
{

View File

@ -54,10 +54,21 @@
{
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,6 +3,7 @@
*/
#include "all.h"
#undef FROG
/* logic
*/
@ -34,6 +35,7 @@
}
}
#ifdef FROG
static u3_noun
_crop_dext_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
@ -59,6 +61,7 @@
return zat;
}
}
#endif
static u3_noun
_crop_dext(u3_noun van,
@ -161,10 +164,22 @@
u3z(dat);
return ret;
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
return u3qf_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);
{
@ -216,10 +231,21 @@
u3z(hin);
return ret;
}
#if 0
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, p_ref, bix);
u3z(fag);
return ret;
}
#endif
case c3__hold: p_ref = u3t(ref);
{
u3_noun rep = u3qfu_repo(van, ref);

View File

@ -8,9 +8,10 @@
u3_noun sut,
u3_noun dep,
u3_noun way,
u3_noun cug,
u3_noun hyp,
u3_noun gil)
{
}
{
@ -55,7 +56,7 @@
u3_noun sut,
u3_noun dep,
u3_noun way,
u3_noun cug,
u3_noun hyp,
u3_noun gil)
{
u3_noun p_sut, q_sut;

View File

@ -3,12 +3,14 @@
*/
#include "all.h"
#undef 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,
@ -29,6 +31,7 @@
return pro;
}
}
#endif
static u3_noun
_fish_in(u3_noun van,
@ -115,10 +118,21 @@
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,6 +3,7 @@
*/
#include "all.h"
#undef FROG
/* logic
*/
@ -32,6 +33,7 @@
}
}
#ifdef FROG
static u3_noun
_fuse_in_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
@ -43,6 +45,7 @@
_fuse_in_frog(van, u3t(p_sut), ref, bix));
}
}
#endif
static u3_noun
_fuse_in(u3_noun van,
@ -143,10 +146,21 @@
u3z(dat);
return ret;
}
#ifdef FROG
case c3__frog: p_sut = u3t(sut);
{
return _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

@ -3,6 +3,7 @@
*/
#include "all.h"
#undef FROG
/* logic
*/
@ -278,6 +279,7 @@
_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 ) {
@ -304,6 +306,16 @@
}
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) ) {
@ -349,7 +361,7 @@
if ( (c3y == tyn) || (c3n == tel) ) {
return tyn;
} else {
#if 0
#ifdef FROG
u3_noun dun = u3qfu_dunq(van, "need", sut);
u3_noun niz = u3qfu_dunq(van, "have", ref);

View File

@ -3,6 +3,7 @@
*/
#include "all.h"
#undef FROG
/* logic
*/
@ -12,6 +13,7 @@
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)
{
@ -23,6 +25,7 @@
_peek_frog(van, u3t(p_sut), way, axe, gil));
}
}
#endif
static u3_noun
_peek_in(u3_noun van,
@ -127,11 +130,22 @@
return pro;
}
}
#ifdef FROG
case c3__frog: {
p_sut = u3t(sut);
return _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

@ -3,8 +3,11 @@
*/
#include "all.h"
#undef 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)
{
@ -16,6 +19,7 @@
_wrap_frog(van, u3t(p_sut), yoz));
}
}
#endif
static u3_noun
_cqfu_wrap(u3_noun van,
@ -50,13 +54,24 @@
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3qf_fork(_cqfu_wrap(van, p_sut, yoz),
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 u3qf_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);