Factor out %cnts for some adjustments.

This commit is contained in:
C. Guy Yarvin 2016-01-08 12:22:42 -08:00
parent 594944bd26
commit 3721de8478
2 changed files with 21 additions and 22 deletions

View File

@ -6,6 +6,19 @@
/* logic
*/
static u3_noun
_fire_vet(u3_noun van)
{
// u3_noun vet = u3j_hook(u3k(van), "vet");
u3_noun vet = u3r_at(u3qfu_van_vet, van);
switch ( vet ) {
case c3n:
case c3y: return vet;
default: return u3m_bail(c3__fail);
}
}
static u3_noun
_fire_mull(u3_noun van,
u3_noun sut,
@ -18,6 +31,9 @@
u3k(gen));
u3_noun ret;
if ( c3n == _fire_vet(van) ) {
ret = c3y;
}
if ( c3y == u3qdi_has(rib, key) ) {
ret = c3y;
}
@ -27,8 +43,11 @@
u3qfu_van_rib,
u3k(rob),
0);
ret = u3qfu_mull(von, sut, c3__noun, dox, gen);
u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen);
ret = c3y;
u3z(mul);
u3z(von);
u3z(rob);
}

View File

@ -9,19 +9,6 @@
static u3_noun
_mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_mull_vet(u3_noun van)
{
// u3_noun vet = u3j_hook(u3k(van), "vet");
u3_noun vet = u3r_at(u3qfu_van_vet, van);
switch ( vet ) {
case c3n:
case c3y: return vet;
default: return u3m_bail(c3__fail);
}
}
static u3_noun
_mull_core(u3_noun pac,
u3_noun con)
@ -698,14 +685,7 @@
u3_noun dox,
u3_noun gen)
{
if ( c3n == _mull_vet(van) ) {
return c3y;
} else {
u3_noun mul = _mull_in(van, sut, gol, dox, gen);
u3z(mul);
return c3y;
}
return _mull_in(van, sut, gol, dox, gen);
}
/* boilerplate