You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -35,7 +37,7 @@ Corrected code - we simply make `cube` a graph, not a node.
35
37
```python
36
38
@csp.graph
37
39
defcube(x: ts[int]) -> ts[int]:
38
-
return x*square(x)
40
+
return x*square(x)
39
41
```
40
42
41
43
2.*Graph code does not access runtime values*. This is the inverse of (1): graph code treats all time-series as Edges and simply "wires" together the application.
@@ -91,3 +93,44 @@ Corrected code - we use `csp.now` instead of `datetime.now` so the node works on
91
93
if time >= csp.now():
92
94
...
93
95
```
96
+
97
+
## `csp.output` vs `return`
98
+
99
+
Sequencing of ticks and returns can be important, and `return` semantics
100
+
are the same in CSP as Python generally.
101
+
In the below example, if `x` ticks at the same time as `alarm`, the second `if` block will not execute.
0 commit comments