go/doc/GoCourseDay1.pdf function literals


As in C, functions can't be declared inside functions -
but function literals can be assigned to variables. Slide 52.
g := func(i int) { //this is a function literal being assigned to a variable.  On the next line g(i) is called, so it's like functions can be declared inside of functions by assigning them to variables?

No comments:

Post a Comment