Fully shifted over to modern typed namespace.

This commit is contained in:
C. Guy Yarvin 2016-02-03 20:51:01 -08:00
parent b26fd40636
commit 35a385e81c
8 changed files with 12 additions and 129 deletions

View File

@ -102,8 +102,6 @@
u3_noun u3we_rub(u3_noun);
u3_noun u3we_lore(u3_noun);
u3_noun u3we_loss(u3_noun);
u3_noun u3we_micq(u3_noun);
u3_noun u3we_mick(u3_noun);
u3_noun u3we_mink(u3_noun);
u3_noun u3we_mule(u3_noun);
u3_noun u3we_repg(u3_noun);

View File

@ -146,8 +146,6 @@
} jed;
struct { // namespace
u3_noun flu; // (list $+(* (unit))), old
u3_noun sea; // (list $+(* (unit))), new
u3_noun gul; // (list $+(* (unit (unit)))) now
} ski;

View File

@ -71,9 +71,7 @@
/* u3m_soft_run(): descend into virtualization context.
*/
u3_noun
u3m_soft_run(u3_noun fly,
u3_noun sea,
u3_noun gul,
u3m_soft_run(u3_noun gul,
u3_funq fun_f,
u3_noun aga,
u3_noun agb);

View File

@ -3,51 +3,8 @@
*/
#include "all.h"
u3_noun
u3we_mink(u3_noun cor)
{
u3_noun bus, fol, fly;
if ( c3n == u3r_mean(cor, u3x_sam_4, &bus,
u3x_sam_5, &fol,
u3x_sam_3, &fly,
0) )
{
return u3m_bail(c3__exit);
}
else {
u3_noun som;
som = u3n_nock_in(u3k(fly), u3k(bus), u3k(fol));
return som;
}
}
u3_noun
u3we_mick(u3_noun cor)
{
u3_noun bus, fol, sea;
if ( c3n == u3r_mean(cor, u3x_sam_4, &bus,
u3x_sam_5, &fol,
u3x_sam_3, &sea,
0) )
{
return u3m_bail(c3__exit);
}
else {
u3_noun som;
som = u3n_nock_it(u3k(sea), u3k(bus), u3k(fol));
return som;
}
}
u3_noun
u3we_micq(u3_noun cor)
{
u3_noun bus, fol, gul;

View File

@ -124,8 +124,6 @@ static u3j_harm _mood__hoon_mat_a[] = {{".2", u3we_mat}, {}};
static u3j_harm _mood__hoon_rub_a[] = {{".2", u3we_rub}, {}};
static u3j_harm _mood__hoon_lore_a[] = {{".2", u3we_lore}, {}};
static u3j_harm _mood__hoon_loss_a[] = {{".2", u3we_loss}, {}};
static u3j_harm _mood__hoon_mick_a[] = {{".2", u3we_mick}, {}};
static u3j_harm _mood__hoon_micq_a[] = {{".2", u3we_micq}, {}};
static u3j_harm _mood__hoon_mink_a[] = {{".2", u3we_mink}, {}};
static u3j_harm _mood__hoon_mule_a[] = {{".2", u3we_mule}, {}};
static u3j_harm _mood__hoon_repg_a[] = {{".2", u3we_repg}, {}};
@ -487,8 +485,6 @@ static u3j_core _mood__hoon_d[] =
{ "lore", _mood__hoon_lore_a },
{ "loss", _mood__hoon_loss_a },
{ "mink", _mood__hoon_mink_a },
{ "mick", _mood__hoon_mick_a },
{ "micq", _mood__hoon_micq_a },
{ "mule", _mood__hoon_mule_a },
{ "repg", _mood__hoon_repg_a },
{ "rexp", _mood__hoon_rexp_a },

View File

@ -469,8 +469,6 @@ u3m_mark(void)
c3_w tot_w = 0;
tot_w += u3h_mark(u3R->jed.har_p);
tot_w += u3a_mark_noun(u3R->jed.das);
tot_w += u3a_mark_noun(u3R->ski.flu);
tot_w += u3a_mark_noun(u3R->ski.sea);
tot_w += u3a_mark_noun(u3R->ski.gul);
tot_w += u3a_mark_noun(u3R->bug.tax);
tot_w += u3a_mark_noun(u3R->bug.mer);
@ -970,9 +968,7 @@ u3m_soft_nock(u3_noun bus, u3_noun fol)
/* u3m_soft_run(): descend into virtualization context.
*/
u3_noun
u3m_soft_run(u3_noun fly,
u3_noun sea,
u3_noun gul,
u3m_soft_run(u3_noun gul,
u3_funq fun_f,
u3_noun aga,
u3_noun agb)
@ -986,8 +982,6 @@ u3m_soft_run(u3_noun fly,
/* Configure the new road.
*/
{
u3R->ski.flu = u3nc(fly, u3to(u3_road, u3R->par_p)->ski.flu);
u3R->ski.sea = u3nc(sea, u3to(u3_road, u3R->par_p)->ski.sea);
u3R->ski.gul = u3nc(gul, u3to(u3_road, u3R->par_p)->ski.gul);
u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don;
u3R->bug.tax = 0;
@ -1050,8 +1044,6 @@ u3m_soft_run(u3_noun fly,
/* Release the arguments.
*/
{
u3z(fly);
u3z(sea);
u3z(gul);
u3z(aga);
u3z(agb);
@ -1067,17 +1059,13 @@ u3m_soft_run(u3_noun fly,
u3_noun
u3m_soft_esc(u3_noun ref, u3_noun sam)
{
u3_noun why, fly, sea, gul, pro;
u3_noun why, gul, pro;
/* Assert preconditions.
*/
{
c3_assert(0 != u3R->ski.flu);
c3_assert(0 != u3R->ski.sea);
c3_assert(0 != u3R->ski.gul);
gul = u3h(u3R->ski.gul);
sea = u3h(u3R->ski.sea);
fly = u3h(u3R->ski.flu);
}
/* Record the cap, and leap.
@ -1087,8 +1075,6 @@ u3m_soft_esc(u3_noun ref, u3_noun sam)
/* Configure the new road.
*/
{
u3R->ski.flu = u3t(u3to(u3_road, u3R->par_p)->ski.flu);
u3R->ski.sea = u3t(u3to(u3_road, u3R->par_p)->ski.sea);
u3R->ski.gul = u3t(u3to(u3_road, u3R->par_p)->ski.gul);
u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don;
u3R->bug.tax = 0;
@ -1097,25 +1083,7 @@ u3m_soft_esc(u3_noun ref, u3_noun sam)
/* Trap for exceptions.
*/
if ( 0 == (why = (u3_noun)_setjmp(u3R->esc.buf)) ) {
if ( 0 != fly ) {
// fprintf(stderr, "fly escape\r\n");
pro = u3n_slam_on(fly, sam);
if ( u3_nul != pro ) {
pro = u3nc(u3_nul, pro);
}
} else if ( 0 != sea ) {
// fprintf(stderr, "sea escape\r\n");
pro = u3n_slam_on(sea, u3nc(ref, sam));
if ( u3_nul != pro ) {
pro = u3nc(u3_nul, pro);
}
} else if ( 0 != gul ) {
// fprintf(stderr, "gul escape\r\n");
pro = u3n_slam_on(gul, u3nc(ref, sam));
}
else {
return u3m_bail(c3__oops);
}
pro = u3n_slam_on(gul, u3nc(ref, sam));
/* Fall back to the old road, leaving temporary memory intact.
*/

View File

@ -422,36 +422,12 @@ u3n_slam_on(u3_noun gat, u3_noun sam)
return u3n_kick_on(cor);
}
/* u3n_nock_it(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_it(u3_noun sea, u3_noun bus, u3_noun fol)
{
return u3m_soft_run(0, sea, 0, u3n_nock_on, bus, fol);
}
/* u3n_nock_et(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_et(u3_noun gul, u3_noun bus, u3_noun fol)
{
return u3m_soft_run(0, 0, gul, u3n_nock_on, bus, fol);
}
/* u3n_nock_in(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_in(u3_noun fly, u3_noun bus, u3_noun fol)
{
return u3m_soft_run(fly, 0, 0, u3n_nock_on, bus, fol);
}
/* u3n_slam_it(): produce (gat sam), as ++toon, in namespace.
*/
u3_noun
u3n_slam_it(u3_noun sea, u3_noun gat, u3_noun sam)
{
return u3m_soft_run(0, sea, 0, u3n_slam_on, gat, sam);
return u3m_soft_run(gul, u3n_nock_on, bus, fol);
}
/* u3n_slam_et(): produce (gat sam), as ++toon, in namespace.
@ -459,15 +435,7 @@ u3n_slam_it(u3_noun sea, u3_noun gat, u3_noun sam)
u3_noun
u3n_slam_et(u3_noun gul, u3_noun gat, u3_noun sam)
{
return u3m_soft_run(0, 0, gul, u3n_slam_on, gat, sam);
}
/* u3n_slam_in(): produce (gat sam), as ++toon, in namespace.
*/
u3_noun
u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam)
{
return u3m_soft_run(fly, 0, 0, u3n_slam_on, gat, sam);
return u3m_soft_run(gul, u3n_slam_on, gat, sam);
}
/* u3n_nock_an(): as slam_in(), but with empty fly.
@ -475,7 +443,7 @@ u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam)
u3_noun
u3n_nock_an(u3_noun bus, u3_noun fol)
{
u3_noun fly = u3nt(u3nc(1, 0), 0, 0); // |=(a=* ~)
u3_noun gul = u3nt(u3nt(1, 0, 0), 0, 0); // |=(a/{* *} ~)
return u3n_nock_in(fly, bus, fol);
return u3n_nock_et(gul, bus, fol);
}

View File

@ -1856,7 +1856,7 @@ _raft_grab(u3_noun ova)
{
if ( u3_nul != u3A->sac ) {
c3_w usr_w = 0, ova_w = 0, sac_w = 0, utv_w = 0, utm_w = 0, wep_w = 0,
har_w = 0, das_w = 0, flu_w = 0, tax_w = 0, mer_w = 0, don_w = 0,
har_w = 0, das_w = 0, gul_w = 0, tax_w = 0, mer_w = 0, don_w = 0,
day_w = 0, car_w = 0;
c3_assert( u3R == &(u3H->rod_u) );
@ -1886,9 +1886,9 @@ _raft_grab(u3_noun ova)
fprintf(stderr, " cold jet state: ");
_raft_print_memory(das_w);
flu_w = u3a_mark_noun(u3R->ski.flu);
gul_w = u3a_mark_noun(u3R->ski.gul);
fprintf(stderr, " namespace: ");
_raft_print_memory(flu_w);
_raft_print_memory(gul_w);
tax_w = u3a_mark_noun(u3R->bug.tax);
fprintf(stderr, " trace stack list: ");
@ -1910,7 +1910,7 @@ _raft_grab(u3_noun ova)
fprintf(stderr, " memoization: ");
_raft_print_memory(car_w);
utm_w = har_w + das_w + flu_w + tax_w + mer_w + don_w + day_w + car_w;
utm_w = har_w + das_w + gul_w + tax_w + mer_w + don_w + day_w + car_w;
fprintf(stderr, "total road stuff: ");
_raft_print_memory(utm_w);