If functions are comparable you have to be very
careful in defining /when/ they are equal.

func f(x int)int {return x+2}
func g(x int)int {return x+2}
func h(x int)int {return x+1+1}

Are f and g equal? f and h?

func k() func (int)int { return func(int x)int {x + 1}}

Are k() and k() equal? f and k()?

var x = 17
func l() func(int)int {y := 2; return func(int x)int {x +y}}

l() and f? and k()? and l()?

Disallowing equality tests on functions allows the
compiler to freely re-use code (or not).

Chris

-- 
Chris "allusive" Dollin

-- 
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.

Reply via email to