I agree that a new keyword seems like overkill, which is one reason I asked 
for other's ideas.

I don't particularly agree that there is no need for a loop that checks its 
condition after instead of before, but in any case it's not a big deal.

Mostly I am interesting in what others think.

On Friday, March 3, 2017 at 5:23:20 PM UTC-5, Ian Lance Taylor wrote:
>
> On Fri, Mar 3, 2017 at 2:00 PM,  <milo.chr...@gmail.com <javascript:>> 
> wrote: 
> > I rather like Go's loops, they are simple and easy to remember, and the 
> > problem so many languages have with dozens of different loop keywords is 
> > neatly avoided. Too many loop types is simply a pain, but I think that 
> one 
> > more wouldn't hurt... 
> > 
> > Basically the following would be helpful in some cases without being too 
> > "odd" compared to what is existing: 
> > 
> > do{ 
> >      // <loop body actions> 
> > }for condition 
> > 
> > Is this a good idea? Why or why not? Anyone else have a better idea for 
> the 
> > syntax? (depending on how you look at it either "do" or "for" is 
> redundant, 
> > but removing "do" would probably require too much lookahead) 
>
> Adding a new keyword "do" would break existing programs. 
>
> The loop is equivalent to 
>
>     for first := true; first || condition; first = false { 
>         ... 
>     } 
>
> This is not the kind of change we are going to make at this stage of 
> the language. 
>
> Ian 
>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to