On Mon, Dec 7, 2020 at 11:18 AM Oliver Smith
<oliver.sm...@superevilmegacorp.com> wrote:
>
> Recognizing this is likely to be a dead horse already flogged to infinity, 
> I've been unsuccessful trying to find discussions on the topic of why while 
> was nixed in-favor of the more verbose and error-prone for-based 
> implementations, hoped someone could furnish links?

Using a single looping construct, for, dates back to the earliest days
of Go (well before I joined the project).  There are no discussions or
links available.  Back then it was just whiteboards and talking.

Go's "for" statement does, of course, support exactly the same
functionality as the "while" statement in C and similar languages (as
well as serving the functionality of the "for" statement).  The
construct missing in Go is not "while" but "do/while".


> // concise, non-repetitive, positively-expressed continuation-clause:
> while n := parser.Next(); isAlpha(n) {
>   // .. use of n ..
> }

Well, this doesn't work in C or related languages either.  You may
want to take a look at https://golang.org/issue/21855.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVVoG1-1UPTQZ%3DjkG74aqPiqHZ%3DgROwfWwV28oRWmQJwg%40mail.gmail.com.

Reply via email to