Home › Forums › kdb+ › how does the query below work › Re: how does the query below work
-
The dictionary
Id!PrevID
is a unary. Applying the Converge iterator to a unaryf
derives a functionf/
(f
Over). When you evaluatef/[x]
, the unaryf
gets applied successively until either (a) the result stops changing (convergence) or (b) the result matchesx
i.e. comes full circle.The white paper on iteration has some examples of iterating lists and dictionaries as finite-state machines.
All this assumes your ID => previous ID paths actually terminate! (You can use the Converge iterator to start an open loop!)