Categories
Tools

System integration

Quflow example: Assembling and dynamically changing components of a system.
[python]
>>> from quflow import Scope
>>> s0 = Scope(x=1)
>>> s1, s2 = s0(y=10), s0(y=100)
>>> with s2: z = x + y + s1.y

>>> s3 = s2(s1) # s1 hides s2 in s3
>>> with s3: print x, y, z

1 10 111
>>> # above came from s0.x, s1.y and s2.z
>>> del s0.x, s1.y
>>> x = 0
>>> with s3: print x, y, z

0 100 111
>>> # above came from x, s2.y and s2.z
[/python]

Leave a comment