[PEAK] Re: trellis.Set.discard

Phillip J. Eby pje at telecommunity.com
Tue Oct 21 20:50:39 EDT 2008


At 08:58 PM 10/21/2008 +0300, Sergey Schetinin wrote:
>Here's another test:
>
>class C1(Component):
>     x = attr()
>
>     @maintain
>     def rule(self):
>         self.x = 1
>
>class C2(Component):
>     c1 = make(C1)
>
>     @compute
>     def calc(self):
>         return self.c1.x
>
>
>c = C2()
>c.calc
>
>@make is triggered inside compute, so C1.rule ends up running with
>ctrl.readonly.

Hm.  ISTM that this is a bug in Component creation, in that it should 
push and restore read-onlyness.  The make() should be idempotent with 
respect to the @compute rule.  Are there any other use cases for side 
transactions?  So far it seems to me that the use cases are all just 
fixing Trellis bugs.  :)

By the way, thank you for reporting and investigating all these 
bugs.  Hopefully I'll have some time soon to fix them all, now that 
it's reasonably clear how to do so.




More information about the PEAK mailing list