[PEAK] Re: trellis.Set.discard
Phillip J. Eby
pje at telecommunity.com
Mon Nov 3 14:58:37 EST 2008
At 09:39 PM 11/3/2008 +0200, Sergey Schetinin wrote:
>We also need to consider that cells can be passed to
>Component.__init__. Consider this:
>
>class C1(Component):
> val = attr()
>
> @maintain
> def rule(self):
> self.val = True
>
>val = Cell()
>
>@atomically
>def test():
> c1 = C1(val=val)
> assert val.value is True
>
>Not just the old values could be set, but also old rules run etc. In
>some cases this is invalid, but in some, when the running rule didn't
>run in current transaction yet it should be OK. But then, the old rule
>should be undoable, the new ones shouldn't.
I think that we need to stop thinking of component initialization as
a side transaction. It really doesn't help in understanding what
should be done.
>...
>This is almost true, but consider the case when we create a component
>and immidiately set one of its discrete cell, this would mean that the
>dependent rules will see the init value, the newly set value, but
>never the reset value in between.
There are more problems with this than just that. See the email
before this one.
>I have a number of small reports / suggestions, would you prefer if I
>created a few new threads for them (they have nothing to do with
>Set.discard anyway =) or is it ok just to list them all in one?
All in one would be fine; might as well start a new thread,
also. The sooner you can do it the better, because this is probably
the only day this week I will be working on any of this.
More information about the PEAK
mailing list