[PEAK] @action rules in Trellis SVN
Grant Baillie
grant at osafoundation.org
Wed Aug 8 19:22:31 EDT 2007
On 7 Aug, 2007, at 13:56, Phillip J. Eby wrote:
> Okay, I've overhauled the Trellis' handling of rules that modify
> other cells; you now have to explicitly mark a rule as a
> @trellis.action in order to be allowed to change cells or invoke
> @modifier functions or methods.
>
> @action rules can't be read by any other rules; they are
> effectively run in bulk at the (logical) end of a recalculation.
>
> The tutorial has been modified a fair bit since last week, so if
> you've read it already, you should definitely review the changes
> using either of these URLs:
>
> http://peak.telecommunity.com/DevCenter/Trellis?
> action=diff&date=1185993742
>
> http://svn.eby-sarna.com/Trellis/README.txt?rev=2380&r1=2379&r2=2380
I'm seeing one unexpected change after this commit. The following
code works in r2379:
>>> d = ChangeableRectangle(width=100, height=150)
>>> d.show # turn on the optional show rule for display purposes
Rectangle((0, 0), (100, 150), (100, 150))
>>> d.wider = 20
Rectangle((0, 0), (120, 150), (120, 150))
However, in r2380 I see
> Failed example:
> d.wider = 20
> Expected:
> Rectangle((0, 0), (120, 150), (120, 150))
> Got nothing
The difference between this and what's covered by the existing
doctest is that I assign a value in the constructor. So far as I can
tell, this shouldn't change the dependency graph, but that appears
not to be the case?
--Grant
More information about the PEAK
mailing list