On Sun, Sep 11, 2016 at 9:27 PM, Lucio <lucio.d...@gmail.com> wrote: > I threw away my efforts to explain my idea, lucidity seems to elude me. > > Instead, here's the gist: > > for continue; x < n; x++ { > ... > } > > Currently, the compiler rejects "continue" in the initialisation field and, > given that it's called "initialisation", that makes sense. > > If instead the "continue" actually caused the loop to skip one iteration, it > may serve a useful purpose and, it seems to me, would still be compatible > with the Go 1.0 promise. > > It is obvious to me what such an option ought to mean, but maybe there are > alternative interpretations that would make the enhancement too ambiguous or > stupid. I'm curious to hear what others think.
My guess as to what this means is that it is precisely equivalent to for x++; x < n; x++ { I suppose the duplication is not ideal, but the code is clear. Putting the continue statement there is an unusual construct that doesn't seem to add much power and would be rarely used. 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.