There would be a way to add them without adding a new keyword:

{
   // stuff
} for condition

I'm not saying I want it, or that it's a good idea, just that "we can't add
a new keyword" doesn't seem a good argument for not doing it. At least at a
cursory glance I don't see why we'd need the do keyword.

On Sat, Mar 4, 2017 at 1:21 AM, Michael Jones <michael.jo...@gmail.com>
wrote:

> I asked for this early...long before it was too late. (Existing valid
> programs ma have variables named 'do' so it is a non starter in that form.
>
> Rob's objection was wise and thoughtful. He wanted Go to be friendly to
> program transformation and he felt that a single uniform iteration
> construct would be "more better" for that than the workarounds you have
> been shown would be "more bad" stylistically.
>
> I did not get what I asked for, but I did get an education about careful
> trade offs.
>
> On Sat, Mar 4, 2017 at 12:06 AM <milo.christian...@gmail.com> wrote:
>
>> It's not really, it is just syntactic sugar. I just happen to think that
>> this kind of loop is common enough to have dedicated syntax. Not
>> necessarily the syntax I used in my example (that has its issues), but
>> something similar.
>>
>> Your example it is how I do it myself currently :)
>>
>>
>> On Friday, March 3, 2017 at 6:00:46 PM UTC-5, peterGo wrote:
>>
>> milo,
>>
>> How is your loop different from this?
>>
>>     for {
>>         // <loop body actions>
>>         if condition {
>>             break
>>         }
>>     }
>>
>> Peter
>>
>> On Friday, March 3, 2017 at 5:00:41 PM UTC-5, milo.chr...@gmail.com
>> 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)
>>
>> --
>> 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.
>>
> --
> Michael T. Jones
> michael.jo...@gmail.com
>
> --
> 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.
>

-- 
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