This might have been discussed, but can't find anything about so easy, 
joined late...

Could generic function definitions be done all in one paramter list using 
the type keyword?

func IndexOf(slice []type T, find type T) int

or
func IndexOf(slice []type T, find T) int



instead of

func IndexOf[type T](slice []T, find T) int 


 
Function calling / instatiating would probably still have a type 
declaration part in [ ] or whatever ends up being used.

It could get messy with contracts / required interfaces, and might not be 
parsable, but might be nice not to repeat types if they are longer names.

 



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0e923dcd-27f7-4973-bcde-ee9dadcb3de2o%40googlegroups.com.

Reply via email to