News for hackers. Stuff that matters.
Re:Why did we choose Rust to develop TiKV? by Vendan on Wednesday September 27, 2017 @01:46PM (#15350329)
Range is hardly return-type polymorphic. It always returns the same things, you are just free to ignore them, i.e.

  for k := range map { }
is the same thing as

  for k, _ := range map { }
Would requiring the second version instead of the first actually be that much of an improvement?

The only true return-type polymorphism is type assertions, which is reasonable in my mind cause I don't think ignoring the "assertion failed" should ever be a logical thing to do.

Re:Why did we choose Rust to develop TiKV? by candiodari on Wednesday September 27, 2017 @11:09PM (#15354253)
Ok. Now consider what happens with slices/arrays instead of maps.

  1) for k := range list {}

  2) for k, i := range list {}
In python, the equivalents are:

  1) for x in lst:

  2) for x, y in enumerate(lst):
So are these "the same" ? No.
Re:Why did we choose Rust to develop TiKV? by Vendan on Thursday September 28, 2017 @08:23AM (#15356558)
more accurately it's

  for index := range list {}
and

  for index, value := range list {}
Yes, these 2 version do perform very similarly, you are just ignoring the second return value in the first version, i.e.:

  for index, _ := range list {}