Open mchirico opened 3 years ago
mchirico, Thanks for opening this issue!
package main
import "fmt"
func hello_mouse(msg string){ fmt.Println(msg) }
func return_msg() func(string){ return func(msg string){ fmt.Print(msg) } } func int_seq() func() int{ i := 0 return func() int{ i++ return i } }
func main() { fmt.Println("Hello hello")
hello_mouse("Hi Mousey")
func(msg string){ fmt.Println(msg) }("Hello there")
print_func := return_msg() print_func("Hello this is the return")
next_int := int_seq()
fmt.Println(next_int()) fmt.Println(next_int()) }
Video
Ref: https://tour.golang.org/moretypes/25
https://repl.it/talk/share/Day-20-Closures/60938