✅ Introduce variable in `while` condition
Is it possible to achieve something like this? (pseudo-C#)
The idea is that the loop should go until the result of some computation does not match some predicate, and to also keep the result of the computation around in the loop.
If not, how would you achieve a similar pattern?
7 Replies
bit of a strange syntax ik
is var val
is a pattern which just declares a variable returns trueOh that's great, thanks 😄
there is also the classic
yikes
it, admittedly, is not a one-liner
I really don't like variable declarations without initialization, but yeah that's a good pattern to know too
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.