If considering user defined Ranger interface, I would strongly suggest to look at D's equivalent. The interface is simple and there are many use of it. It is trivial to develop a reverse range or ranges that traverse data structures (e.g. binary trees) in different ways (once you have generics).
My experience with it (as a beginner) was that it makes the code less readable. There is a tendency to overuse it because a "for range" is concise and looks simple. But it is not because one has to lookup the "Ranger" implementation to understand what it is doing. When you know by hart what each "Ranger" does, you can still read and understand the code, but this is for the elites. It may give an impression of power to those mastering it, but it gives an impression of frustration to people learning the language. This also adds the burden to decide which "Ranger" to use, or to determine if there is a Ranger for what I want to do. The power of Go is its simplicity and readability. Let it stay that way. As it has already been said, it's only syntactic sugar. -- 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.