3 ms·
Can you detect cycles in general though? At first blush it feels like a halting problem.
by Y_Y 4y ago
Can you detect cycles in general though? At first blush it feels like a halting problem.
- chowells 4y agoYou can't detect all possible cycles statically, but you can definitely detect them when they happen at runtime. When calculating a value, track its dynamic dependencies. If it ends up depending on itself, you have a cycle.