Commit 8a44ec9dad689754e199eb665f567ad7097d3aef

Thomas de Grivel 2024-03-23T14:49:15

better definition for double_tuple

diff --git a/.ic3_history b/.ic3_history
index c327d58..a110ecd 100644
--- a/.ic3_history
+++ b/.ic3_history
@@ -1,30 +1,3 @@
-sqrt(-1) * sqrt(-1)
-sqrt(-2) * sqrt(-2)
-1/3 +i 1/2
-1 +i 2
-1/2 +i 2/3
-(1/2 +i 2/3 +i 3/4) * 1/2
-(1/2 +i 2/3 +i 3/4) - 1/2
-1 - 1/2
-1/2 - 1
-1/2 - 3/4
-1 - 3/4
-1/2 * 3/4
-2/3 * 3/4
-2/3 / 3/4
-1 / sqrt(2)
-(1 +i 2) / 3
-(10 +i 20) / 3
-(10/1 +i 20/1) / 3
-(1/2 +i 2/3) / 2
-5 % 3
-5 mod 3
-15 mod 3
--15 mod 3
--15 mod -3
--15 mod -2
--15 mod -5
--15 mod -6
 -15 mod 6
 3 mod sqrt(2)
 4 mod sqrt(2)
@@ -97,3 +70,30 @@ def reverse = fn (x) { List.reverse(x) }
 reverse([1, 2, 3])
 def reverse = fn (x) { List.reverse(x) }
 C3.reverse
+def dt = macro (x) do
+  quote do
+    x = ^ x
+    {x, x}
+  end
+end
+dt(200)
+def dt = macro (x) do
+  quote do
+    x = unquote x
+def dt = macro (x) do
+  quote do
+    x = unquote(x)
+    {x, x}
+  end
+end
+dt(200)
+dt(a)
+a = [1, 2, 3]
+dt(a)
+def dt = macro (x) do
+  quote do
+    x = ^ unquote(x)
+    {x, x}
+  end
+end
+dt(a)
diff --git a/test/ic3/def.in b/test/ic3/def.in
index 21cfd02..6305fca 100644
--- a/test/ic3/def.in
+++ b/test/ic3/def.in
@@ -15,10 +15,16 @@ double(200)
 quote double(zero)
 double(zero)
 quote def double_tuple = macro (x) do
-  {x, x}
+  quote do
+    x = ^ unquote(x)
+    {x, x}
+  end
 end
 def double_tuple = macro (x) do
-  {x, x}
+  quote do
+    x = ^ unquote(x)
+    {x, x}
+  end
 end
 quote double_tuple
 double_tuple
diff --git a/test/ic3/def.out.expected b/test/ic3/def.out.expected
index 396da43..2afe3bc 100644
--- a/test/ic3/def.out.expected
+++ b/test/ic3/def.out.expected
@@ -15,13 +15,19 @@ double(200)
 double(zero)
 0
 def double_tuple = macro (x) do
+  quote do
+  x = ^ unquote(x)
   {x, x}
 end
+end
 C3.double_tuple
 double_tuple
 macro (x) do
+  quote do
+  x = ^ unquote(x)
   {x, x}
 end
+end
 double_tuple(200)
 {200, 200}
 double_tuple(zero)