News for hackers. Stuff that matters.
Re:Go 2, here we come by nordsieck on Thursday November 29, 2018 @07:47PM (#18565638)
> I'm curious what the motivation was to use int instead of uint considering indexes cannot be negative in Go.

I want to emphasize that I do not know the true answer to this question.

I think that indexes are int to play nicely with a decrementing loop counter. Doing:

    for i := len(n) - 1; i >= 0; i-- { fmt.Println(n[i]) }
requires i to be signed due to the last iteration.
Re:Go 2, here we come by a1369209993 on Thursday November 29, 2018 @10:56PM (#18566535)
I'm not sure about go, but in C this could be:

  for(size_t i = zn; i-- > 0 ;) printf("%s\n",n[i]);
(This is a large part of why unsigned over/underflow is well-defined behavior in C.)
Re:Go 2, here we come by nordsieck on Thursday November 29, 2018 @11:28PM (#18566665)
In Go, i++/i-- is a statement, not an expression, so that doesn't work.

More generally, assignment is always a statement, and never an expression (e.g. you can't say a = b = c)