On Wednesday, November 23, 2016 at 11:11:24 PM UTC+8, Axel Wagner wrote: > > So, even though two functions do completely different things, you still > want to have them equal? And even though two other functions do completely > the same thing, they should be different? >
If two functions do completely different things, they mus be two different functions. Two different functions can also do the same thing, but they should be not equal. > > Can you give a good justification of that behavior? And do you really > think it won't confuse people like hell? > > One of the main reasons given for not making functions comparable, is that > there is no good, intuitive notion of what "equality" means in the face of > inlining and closures, so *no matter what behavior you choose*, people will > be confused. > > On Wed, Nov 23, 2016 at 4:01 PM, T L <tapi...@gmail.com <javascript:>> > wrote: > >> >> >> On Wednesday, November 23, 2016 at 10:39:01 PM UTC+8, Volker Dobler wrote: >>> >>> Am Mittwoch, 23. November 2016 15:30:39 UTC+1 schrieb T L: >>>> >>>> >>>> >>>> On Wednesday, November 23, 2016 at 9:53:57 PM UTC+8, Volker Dobler >>>> wrote: >>>>> >>>>> Just one argument out of many: Closures. >>>>> x := 3 >>>>> f1 := func() int { >>>>> return x >>>>> } >>>>> f2 := func() int { return 3 } >>>>> // Is f1 == f2 ? >>>>> >>>>> x = 4 >>>>> // What now? Still f1 == f2? Or never equal? >>>>> >>>>> >>>> Any bad to think then never equal? >>>> >>> >>> That's basically is it: If functions are never equal so it is >>> not sensible make them comparable. >>> >>> V. >>> >> >> functions from the same declaration are equal. >> and function variables at the same address are equal. >> >> >> -- >> 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...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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.