summaryrefslogtreecommitdiff
path: root/vere/pkg/noun/jets/d/by_urn.c
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 01:01:41 +0700
committerpolwex <polwex@sortug.com>2025-10-06 01:01:41 +0700
commitc4b392a179048f936c062f5ffccc2bc25627e500 (patch)
tree09be0904be8ec4d7ea52992ef7580d42ed0c28c1 /vere/pkg/noun/jets/d/by_urn.c
working
Diffstat (limited to 'vere/pkg/noun/jets/d/by_urn.c')
-rw-r--r--vere/pkg/noun/jets/d/by_urn.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/vere/pkg/noun/jets/d/by_urn.c b/vere/pkg/noun/jets/d/by_urn.c
new file mode 100644
index 0000000..bab555a
--- /dev/null
+++ b/vere/pkg/noun/jets/d/by_urn.c
@@ -0,0 +1,43 @@
+/// @file
+
+#include "jets/q.h"
+#include "jets/w.h"
+
+#include "noun.h"
+
+static u3_noun
+_by_urn(u3_noun a, u3j_site* sit_u)
+{
+ if ( u3_nul == a ) {
+ return u3_nul;
+ }
+ else {
+ u3_noun n_a, l_a, r_a;
+ u3x_trel(a, &n_a, &l_a, &r_a);
+
+ return u3nt(u3nc(u3k(u3h(n_a)), u3j_gate_slam(sit_u, u3k(n_a))),
+ _by_urn(l_a, sit_u),
+ _by_urn(r_a, sit_u));
+ }
+}
+
+u3_noun
+u3qdb_urn(u3_noun a, u3_noun b)
+{
+ u3_noun pro;
+ u3j_site sit_u;
+
+ u3j_gate_prep(&sit_u, u3k(b));
+ pro = _by_urn(a, &sit_u);
+ u3j_gate_lose(&sit_u);
+
+ return pro;
+}
+
+u3_noun
+u3wdb_urn(u3_noun cor)
+{
+ u3_noun a, b;
+ u3x_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0);
+ return u3qdb_urn(a, b);
+}