summaryrefslogtreecommitdiff
path: root/vere/pkg/noun/jets/f/flip.c
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
committerpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
commitfcedfddf00b3f994e4f4e40332ac7fc192c63244 (patch)
tree51d38e62c7bdfcc5f9a5e9435fe820c93cfc9a3d /vere/pkg/noun/jets/f/flip.c
claude is gud
Diffstat (limited to 'vere/pkg/noun/jets/f/flip.c')
-rw-r--r--vere/pkg/noun/jets/f/flip.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/vere/pkg/noun/jets/f/flip.c b/vere/pkg/noun/jets/f/flip.c
new file mode 100644
index 0000000..9eb922e
--- /dev/null
+++ b/vere/pkg/noun/jets/f/flip.c
@@ -0,0 +1,39 @@
+/// @file
+
+#include "jets/q.h"
+#include "jets/w.h"
+
+#include "noun.h"
+
+
+ u3_noun
+ u3qf_flip(u3_noun hel)
+ {
+ if ( c3y == u3r_sing(1, u3h(hel)) ) {
+ if ( (c3y == u3t(hel)) ) {
+ return u3nc(1, c3n);
+ }
+ else {
+ u3_assert((c3n == u3t(hel)));
+
+ return u3nc(1, c3y);
+ }
+ }
+ else {
+ return u3nq(6,
+ u3k(hel),
+ u3nc(1, c3n),
+ u3nc(1, c3y));
+ }
+ }
+ u3_noun
+ u3wf_flip_139(u3_noun cor)
+ {
+ u3_noun hel;
+
+ if ( u3_none == (hel = u3r_at(u3x_sam, cor)) ) {
+ return u3m_bail(c3__fail);
+ } else {
+ return u3qf_flip(hel);
+ }
+ }