summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-11 23:31:05 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-11 23:31:05 +0000
commit2ff4b85fc73f0cf82034e2a19ea8c5d677812c9c (patch)
tree9792ced45b99792a8794eaf4108f551623f2a45b /functions.c
parent37fe04b08b3cae7390f75eb1bb25d8fd4e958384 (diff)
Add ⊣ and ⊢
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/functions.c b/functions.c
index 71e5400..cf5402a 100644
--- a/functions.c
+++ b/functions.c
@@ -22,8 +22,8 @@ fnmonad monadfunctiondefs[] = {
0, /* ⌊ */
0, /* ⊥ */
0, /* ⊤ */
- 0, /* ⊣ */
- 0, /* ⊢ */
+ fnSame, /* ⊣ */
+ fnSame, /* ⊢ */
0, /* = */
0, /* ≠ */
0, /* ≤ */
@@ -77,8 +77,8 @@ fndyad dyadfunctiondefs[] = {
0, /* ⌊ */
0, /* ⊥ */
0, /* ⊤ */
- 0, /* ⊣ */
- 0, /* ⊢ */
+ fnLeft, /* ⊣ */
+ fnRight, /* ⊢ */
0, /* = */
0, /* ≠ */
0, /* ≤ */
@@ -119,6 +119,12 @@ fndyad dyadfunctiondefs[] = {
/* Monadic functions */
Array *
+fnSame(Array *right)
+{
+ return right;
+}
+
+Array *
fnTally(Array *right)
{
return mkscalarint(right->rank==0 ? 1 : right->shape[0]);
@@ -168,6 +174,20 @@ fnShape(Array *right)
/* Dyadic functions */
Array *
+fnLeft(Array *left, Array *right)
+{
+ USED(right);
+ return left;
+}
+
+Array *
+fnRight(Array *left, Array *right)
+{
+ USED(left);
+ return right;
+}
+
+Array *
fnCatenateFirst(Array *left, Array *right)
{
/* not even close to being right, but it works for stranding :) */