I'm sympathetic to the general idea, but I don't think this quite does it. In addition to introducing a bunch of new names, it's not expressive enough:
- You can't express "string or []byte", as you note. There are many algorithms where this would be useful. See the strings and bytes packages for a start. - You can't support types that have bool and string as underlying types. People often define their own string type, usually just for clarity. You say they can just convert to string, but they can't if they have a []MyString or the like. It's also confusingly inconsistent to support underlying types for numbers but not bool or string. - Your convert example excludes complex types. You have no way to express "any numeric type," which is what that example needs. - You can't get finer-grained than Integer. That excludes some code. For instance, your Add1K example doesn't work, because it won't compile if T = int8. It's not clear how important this is in practice. -- 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.