From fcedfddf00b3f994e4f4e40332ac7fc192c63244 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 5 Oct 2025 21:56:51 +0700 Subject: claude is gud --- vere/pkg/noun/jets/e/jam.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 vere/pkg/noun/jets/e/jam.c (limited to 'vere/pkg/noun/jets/e/jam.c') diff --git a/vere/pkg/noun/jets/e/jam.c b/vere/pkg/noun/jets/e/jam.c new file mode 100644 index 0000000..2291bc0 --- /dev/null +++ b/vere/pkg/noun/jets/e/jam.c @@ -0,0 +1,60 @@ +/// @file + +#include "jets/k.h" +#include "jets/q.h" +#include "jets/w.h" + +#include "noun.h" + +u3_noun +u3qe_jam(u3_atom a) +{ +#if 0 + if (c3y == u3du(a) && 1337 == u3h(a)) { + c3_w siz_w, tot_w = 0; + u3_noun som; + for ( som = u3t(a); c3y == u3du(som); som = u3t(som) ) { + siz_w = u3a_count_noun(u3h(som)); + tot_w += siz_w; + if ( 0 == siz_w ) { + u3l_log("item: B/0"); + } + else { + u3a_print_memory(stderr, "item", siz_w); + } + } + if ( u3_blip != som ) { + u3l_log("forgot to terminate list!"); + } + c3_w mem_w = u3h_count(u3R->cax.har_p); + + for ( som = u3t(a); c3y == u3du(som); som = u3t(som) ) u3a_discount_noun(u3h(som)); + u3h_discount(u3R->cax.har_p); + + u3a_print_memory(stderr, "total", tot_w); + u3a_print_memory(stderr, "memoization cache", mem_w); + u3h_root* har_u = u3to(u3h_root, u3R->cax.har_p); + u3l_log("memoization entries: %d", har_u->use_w); + u3a_print_memory(stderr, "unused free", u3a_open(u3R)); + return tot_w; + } +#endif + + u3i_slab sab_u; + u3s_jam_fib(&sab_u, a); + return u3i_slab_mint(&sab_u); +} + +u3_noun +u3we_jam(u3_noun cor) +{ + return u3qe_jam(u3x_at(u3x_sam, cor)); +} + +u3_atom +u3ke_jam(u3_noun a) +{ + u3_atom b = u3qe_jam(a); + u3z(a); + return b; +} -- cgit v1.2.3