>
> It seems annoying to force
> everyone to write interface{} all the time when it is normally not
> needed.
>
I agree, omitting interface{} should not cause much trouble to the parser.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Wed, Jun 17, 2020 at 4:19 AM Hal wrote:
>
> "If a constraint is specified for any type parameter, every type parameter
> must have a constraint. If some type parameters need a constraint and some do
> not, those that do not should have a constraint of interface{}."
>
> "interface{}" equals
On Wed, Jun 17, 2020 at 1:19 PM Hal wrote:
> * the syntax defining generic function is verbose on purpose (type
> keyword), not only for clarification, but also a remind of the cost and
> complexity behind generics
>
I don't know where this idea is from, but it's not accurate. The type
keyword
"If a constraint is specified for any type parameter, every type parameter
must have a constraint. If some type parameters need a constraint and some
do not, those that do not should have a constraint of interface{}."
"interface{}" equals to "Any Type" in the context of generics. So it seems