by Ricardo Fernández Serrata
Checks if ANY 2 values are "deeply equal" (can check flat and nested containers). It uses an explicit stack to avoid subroutine calls, for better performance and memory usage.
I used a stack format where each frame contains a 3-tuple (array of fixed length of 3), instead of storing each value as an individual frame. S[-1] is the last (top) stack frame. S[-1] is the iteration index of the last frame. S and S are inputs A and B respectively. S[-1] and S[-1] are inner (deeper) values of A and B.
If I didn't use 3-tuples, the format would've been like this: S[-1] is B, S[-2] is A and S[-3] is the iteration index. This format would require more blocks, so I fit all 3 values in 1 frame for a minified flow.
I already included example inputs, you can edit them to check correctness of this flow.
Simplified/minified edition: llamalab.com/automate/community/flows/39235
There are some special cases where "=" operator successfully detects that 2 containers are equal. This happens when 2 or more variables are referencing the same memory address (shared data structure), which allows programming languages (AM included) to easily detect the equality of these variables just by reading metadata.
This is why I included the "a = b" check, to avoid unnecessary processing, when possible
Rate and review within the app in the Community section.