summaryrefslogtreecommitdiff
path: root/vere/pkg/noun
diff options
context:
space:
mode:
Diffstat (limited to 'vere/pkg/noun')
-rw-r--r--vere/pkg/noun/nock.c29
-rw-r--r--vere/pkg/noun/vortex.c23
2 files changed, 52 insertions, 0 deletions
diff --git a/vere/pkg/noun/nock.c b/vere/pkg/noun/nock.c
index 8218efa..8de6d7e 100644
--- a/vere/pkg/noun/nock.c
+++ b/vere/pkg/noun/nock.c
@@ -8,6 +8,7 @@
#include "jets.h"
#include "jets/k.h"
#include "jets/q.h"
+#include "log.h"
#include "manage.h"
#include "options.h"
#include "retrieve.h"
@@ -167,6 +168,17 @@ _n_nock_on(u3_noun bus, u3_noun fol)
u3R->pro.nox_d += 1;
#endif
+ // Trace first 30 opcodes
+ static c3_w opcode_count = 0;
+ if ( opcode_count < 30 ) {
+ if ( c3y == u3du(hib) ) {
+ u3l_log("[C-Nock:%u] cell-cell formula", opcode_count);
+ } else {
+ u3l_log("[C-Nock:%u] opcode %u", opcode_count, hib);
+ }
+ opcode_count++;
+ }
+
if ( c3y == u3du(hib) ) {
u3_noun poz, riv;
@@ -2907,6 +2919,17 @@ u3n_burn(u3p(u3n_prog) pog_p, u3_noun bus)
static u3_noun
_n_burn_on(u3_noun bus, u3_noun fol)
{
+ static c3_w burn_count = 0;
+ if ( burn_count < 30 ) {
+ u3_noun hib = u3h(fol);
+ if ( c3y == u3du(hib) ) {
+ u3l_log("[C-Burn:%u] cell-cell formula", burn_count);
+ } else {
+ u3l_log("[C-Burn:%u] opcode %u", burn_count, hib);
+ }
+ burn_count++;
+ }
+
u3n_prog* pog_u = _n_find(u3_nul, fol);
u3z(fol);
@@ -2920,6 +2943,12 @@ u3n_nock_on(u3_noun bus, u3_noun fol)
{
u3_noun pro;
+ static c3_w call_count = 0;
+ if ( call_count < 10 ) {
+ u3l_log(">>> u3n_nock_on call #%u <<<", call_count);
+ call_count++;
+ }
+
u3t_on(noc_o);
#if 0
pro = _n_nock_on(bus, fol);
diff --git a/vere/pkg/noun/vortex.c b/vere/pkg/noun/vortex.c
index 63b4fc2..e4b55d9 100644
--- a/vere/pkg/noun/vortex.c
+++ b/vere/pkg/noun/vortex.c
@@ -38,7 +38,30 @@ u3v_life(u3_noun eve)
u3l_log("u3v_life: processing %llu events", (unsigned long long)len_d);
u3_noun lyf = u3nt(2, u3nc(0, 3), u3nc(0, 2));
+
+ // Log eve structure before nock
+ u3l_log("u3v_life: eve is %s", (c3y == u3a_is_atom(eve)) ? "atom" : "cell");
+ if ( c3y == u3a_is_cell(eve) ) {
+ u3_noun eve_h = u3h(eve);
+ u3_noun eve_t = u3t(eve);
+ u3l_log("u3v_life: eve head is %s", (c3y == u3a_is_atom(eve_h)) ? "atom" : "cell");
+ u3l_log("u3v_life: eve tail is %s", (c3y == u3a_is_atom(eve_t)) ? "atom" : "cell");
+
+ if ( c3y == u3a_is_cell(eve_h) ) {
+ u3_noun eve_hh = u3h(eve_h);
+ u3_noun eve_ht = u3t(eve_h);
+ u3l_log("u3v_life: eve head.head is %s", (c3y == u3a_is_atom(eve_hh)) ? "atom" : "cell");
+ if ( c3y == u3a_is_atom(eve_hh) ) {
+ u3l_log("u3v_life: eve head.head = %u", u3r_word(0, eve_hh));
+ }
+ u3l_log("u3v_life: eve head.tail is %s", (c3y == u3a_is_atom(eve_ht)) ? "atom" : "cell");
+ }
+ }
+
+ u3l_log("u3v_life: calling u3n_nock_on(eve, [2 [0 3] [0 2]])...");
u3_noun gat = u3n_nock_on(eve, lyf);
+ u3l_log("u3v_life: u3n_nock_on returned successfully");
+
u3_noun cor = u3k(u3x_at(7, gat));
u3z(gat);