Hi Garry, I like the use of a bool loop variable to show intent. So I
added an entry in page Do-while-loop idiom in Go
<http://www.programming-idioms.org/idiom/78/do-while-loop/1847/go>.
Cheers
Val
On Sunday, October 9, 2016 at 5:15:51 AM UTC+2, Gary Scarr wrote:
>
>
> I prefer to show the intent of the bool with something like
>
> for done :=false;!done;{
>
>
> //stuff
>
>
> done = xxx // done = expr in until(expr)
>
>
> }
>
>
>
>
>
>
> On Friday, October 7, 2016 at 7:25:02 PM UTC-4, [email protected] wrote:
>>
>> Any suggestions on a way to write a repeat until loop equivalent in
>> golang that looks tidy
>>
>> currently I do :
>>
>> ib := true
>> for i := a.X; i != b.X || ib; i = i + b.X - a.X {
>> ib = false
>> //stuff
>> }
>>
>>
>> for loops that need to be executed once under all conditions..
>>
>> maybe there's neater or better way ?
>>
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.