git @ Cat's Eye Technologies Xoomonk / 4ca3047
Fix MalingeringStore.copy(). catseye 9 years ago
2 changed file(s) with 26 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
178178 | print a
179179 = [c=7,d=7]
180180 = [c=4,d=7]
181
182 Saturating one copy of an unsaturated block will not saturate the other
183 copy.
184
185 | a := {
186 | print string "saturated"
187 | d := c
188 | }
189 | b := a*
190 | print a
191 | print b
192 | a.c := 7
193 | print a
194 | print b
195 | b.c := 5
196 | print b
197 = [c=?,d=0]
198 = [c=?,d=0]
199 = saturated
200 = [c=7,d=7]
201 = [c=?,d=0]
202 = saturated
203 = [c=5,d=5]
181204
182205 Unassigned variables cannot be accessed from an unsaturated store.
183206
272272 self.fun(self)
273273
274274 def copy(self):
275 # probably not entirely right
276 new = MalingeringStore(self.variables, self.unassigned, self.fun)
275 new = MalingeringStore(
276 set(self.variables), set(self.unassigned), self.fun
277 )
277278 new.dict = self.dict.copy()
278279 return new
279280