After all the discussions about contracts, this is a refreshing new idea that is conceptually far simpler. Sure the details need to be worked out, maybe with a somewhat different syntax, but it seems far better than the idea of contracts indeed. A type is a "contract" in itself, and a primitive type, represents a "contract" for the operations that primitive supports. I think that is brilliant! Also, maybe something else than the key word "like" could be used? Maybe something like this:
func Fields(T like ([]byte && string) (s T) []T // T is and intersection type, supports all operations that both []byte and string support. That would allow us to unify the strings and bytes package as well. And you could then also use it fur a []rune as well! -- 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.