Commits

catseye  committed 8eb420e

Fix MalingeringStore.copy().

  • Participants
  • Parent commits 40a9ba4

Comments (0)

Files changed (2)

File README.markdown

     = [c=7,d=7]
     = [c=4,d=7]
 
+Saturating one copy of an unsaturated block will not saturate the other
+copy.
+
+    | a := {
+    |   print string "saturated"
+    |   d := c
+    | }
+    | b := a*
+    | print a
+    | print b
+    | a.c := 7
+    | print a
+    | print b
+    | b.c := 5
+    | print b
+    = [c=?,d=0]
+    = [c=?,d=0]
+    = saturated
+    = [c=7,d=7]
+    = [c=?,d=0]
+    = saturated
+    = [c=5,d=5]
+
 Unassigned variables cannot be accessed from an unsaturated store.
 
     | a := {

File src/xoomonk.py

         self.fun(self)
 
     def copy(self):
-        # probably not entirely right
-        new = MalingeringStore(self.variables, self.unassigned, self.fun)
+        new = MalingeringStore(
+            set(self.variables), set(self.unassigned), self.fun
+        )
         new.dict = self.dict.copy()
         return new