Hallöchen! Kurtis Rader writes:
> On Wed, Oct 11, 2023 at 10:31 PM Torsten Bronger < > bron...@physik.rwth-aachen.de> wrote: > > 'Axel Wagner' via golang-nuts writes: > > > [...] > > > > What would this do? > > > > func F(s []any) { > > s[0] = "Foo" > > } > > func main() { > > s := []int{1,2,3,4} > > F(s) > > fmt.Println(s) > > } > > I think most intuitive would be if this behaved as an implicit > instantiation of the function with the type passed to it. > > No. That is a recipe for disaster. You are arguing that container > types (such as slices or maps) should be automatically converted. I am not sure that you understood me correctly. Anyway, I mean instantiation of F with a concrete type before the actual compilation step. The same thing already happens if you write F[T []E, E any](s T). Regards, Torsten. -- Torsten Bronger -- 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/87pm1kz73m.fsf%40physik.rwth-aachen.de.