7 ms·
in K, there is an adverb form which is essentially equivalent to a while loop: apply a function or composition to a value repeatedly as long as a second functio
by RodgerTheGreat 5y ago
in K, there is an adverb form which is essentially equivalent to a while loop: apply a function or composition to a value repeatedly as long as a second function or composition of that value yields true.
It's basically an "escape hatch" when an algorithm cannot be cast into any more specific pattern, like iteration, a fixed-point, a reduction, etc. In practice it is needed very rarely.
There's a complete list of adverb forms for k6 here: https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md#adverb-reference https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual....