Maybe the central issue here has been lost because of the confusion between
English words and the keywords of various languages. Let's be explicit: *a
controlled looping construct may test the control condition before or after
the iterated body of code. Go's 'for' tests before and and Go does not
provide keyword means to specify the test happen after.*

Not a crisis, everyone works around this, but, the workaround is a
workaround. Language shapes thought. Languages that express test-after in
their vocabulary embrace code and data structuring that depend on it.
People who know such languages (such as C and others) will miss it. In 800
AD Charlemagne said, "To have a second language is to have a second soul."
Same for computer languages.



On Thu, May 10, 2018 at 7:17 AM <matthewju...@gmail.com> wrote:

> The lack of citations makes the content untrustworthy to me, but this
> English Wikipedia article on loops claims some history starting with the do
> loop in FORTRAN (1957): https://en.wikipedia.org/wiki/For_loop
>
> This article says the three part for loop was introduced in C/C++ (1972),
> and container iteration was introduced in Maple (1980).
>
> for e in c while w do
>     # loop body
> od;
>
> The people writing these articles claim “Do while”, “While”, “For”,
> “Foreach”, and “Infinite” are loop constructs. All of these are done by for
> in Go.
>
> Another observation from this novice Go programmer: I'm puzzled why
>> there's no while statement.
>
>
> I think “it was an arbitrary choice based on experience” might be the
> answer but I don’t know. I like having the one keyword.
>
> Matt
>
> On Tuesday, May 1, 2018 at 6:11:04 AM UTC-5, Hugh Fisher wrote:
>>
>>
>> Another observation from this novice Go programmer: I'm puzzled why
>> there's no while statement.
>>
>> I know it's possible to use a for, but it doesn't feel right to me. I
>> always
>> think of for loops as for iterating over data structures. Originally just
>> arrays, but languages like Python and Objective-C have extended for
>> loops to other collections as well. "Looping until some condition is met"
>> for me is a different control structure and needs a different keyword.
>>
>> There'd be overlap with the for statement, but if-then-else and switch
>> with boolean case overlap too.
>>
>> And since while has been a reserved keyword in a lot of programming
>> languages for many decades, I would bet a reasonable amount of
>> money that a while statement could be added to Go right now and not
>> break anyone's production code.
>>
>> cheers,
>> Hugh Fisher
>>
>> --
> 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.

Reply via email to