They work just the same at the top level as they do inside a function:
http://golang.org/doc/go_spec.html#Function_declarations
func f() {
g(func () int { return 1; });
}
And, yes, they are closures.
AGL
The type system rather preludes them. They would either have to use
reflection (slow) or be specialised for each type of slice.
AGL
The compiler could resolve the polymorphism locally into a monomorphic
operation, like Fortran or GNU C intrinsic functions (which are
polymorphic over different real and complex types). That would
require hacking the compiler or adding hygienic macros. In essence
they'd be new syntax rather than functions.
>
>
> AGL
>
--
GMail doesn't have rotating .sigs, but you can see mine at
http://www.ccil.org/~cowan/signatures