shrub/jets/f/ut_buss.c

94 lines
2.0 KiB
C
Raw Normal View History

2016-01-16 04:42:50 +03:00
/* j/6/ut_buss.c
**
*/
#include "all.h"
/* logic
*/
2017-09-28 03:40:12 +03:00
static u3_noun
2016-01-16 04:42:50 +03:00
_cqfu_buss(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun gen)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
2018-04-27 02:36:29 +03:00
u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss");
2016-01-16 04:42:50 +03:00
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(cog),
u3x_sam_3,
u3k(gen),
0));
}
2017-09-28 03:40:12 +03:00
static u3_noun
_cqfu_busk(u3_noun van,
u3_noun sut,
u3_noun gen)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
2018-04-27 02:36:29 +03:00
u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk");
2017-09-28 03:40:12 +03:00
return u3n_kick_on(u3i_molt(gat,
u3x_sam,
u3k(gen),
0));
}
2016-01-16 04:42:50 +03:00
/* boilerplate
*/
u3_noun
u3wfu_buss(u3_noun cor)
{
u3_noun sut, cog, gen, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog,
u3x_sam_3, &gen,
u3x_con, &van,
0)) ||
(c3n == u3ud(cog)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_buss(van, sut, cog, gen);
}
}
u3_noun
u3qfu_buss(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun gen)
{
return _cqfu_buss(van, sut, cog, gen);
}
2017-09-28 03:40:12 +03:00
u3_noun
u3wfu_busk(u3_noun cor)
{
u3_noun sut, gen, van;
if ( (c3n == u3r_mean(cor, u3x_sam, &gen,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_busk(van, sut, gen);
}
}
u3_noun
u3qfu_busk(u3_noun van,
u3_noun sut,
u3_noun gen)
{
return _cqfu_busk(van, sut, gen);
}