A while loop can be written as follows in C# (and many other languages):
int someValue;
int someTerminatingValue;
while ((someValue = GetSomeValue()) != someTerminatingValue)
{
// Do something interesting
}
Is there a name for this pattern of assigning the value inside the while loop's expression?
NB I'm not asking if it is a good idea or a bad idea, just if there's a name for this pattern. Whether it's good or bad, people will see it so they need to know what it is. If there isn't a name for it then that's fine, I'm just asking if there is one.
while (condition)
is simply more clear in it's intent than what you have there. Just don't do it, and your question becomes moot. No it doesn't have a name, for it is not common, and there's good reason.