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
Copy file name to clipboardexpand all lines: README.md
+29-29
Original file line number
Diff line number
Diff line change
@@ -60,35 +60,6 @@ expressing branches; Nodely allows for conditional dependencies that
60
60
defer evaluation until run time checks have determined it is necessary
61
61
to evaluate a dependency.
62
62
63
-
### Cycle Detection
64
-
65
-
Nodely provides a handy function that throws an error when a cycle has been detected in your _environment_. To use this function, simply execute the following code:
66
-
67
-
```clj
68
-
(comment
69
-
(require '[nodely.api.v0 :as nodely])
70
-
(nodely/checked-env
71
-
{:a (nodely/>value1)
72
-
:b (nodely/>leaf (even? ?a))})
73
-
) ;; When no cycle is detected, returns env {:a #:nodely.data{:type :value, :value 1}...}
74
-
```
75
-
76
-
>Avoid using the `checked-env` function at runtime, as its calculations can be costly. It is recommended to perform this verification only during development, using the REPL.
77
-
78
-
It's important to be aware that this function may sometimes produce false positives when dealing with graphs that contain mutually exclusive conditions. Here's an example where the function might produce a false positive:
79
-
80
-
```clj
81
-
(comment
82
-
(require '[nodely.api.v0 :as nodely])
83
-
(nodely/checked-env
84
-
{:f (>if (>leaf ?c) :it-was-even! (>leaf ?e))
85
-
:e (>if (>leaf ?c) (>leaf ?f) :it-was-odd!)
86
-
:c (>leaf (even? (rand-int2)))})
87
-
) ;; throws "Checked-env found cycles at compile time"
88
-
```
89
-
90
-
Keep in mind these limitations and double-check the results if your graph contains such scenarios.
91
-
92
63
## Definitions
93
64
94
65
### Nodes
@@ -358,6 +329,35 @@ core.async workers deadlock, waiting on each other to complete.
0 commit comments