Getting func(y) with Channels
Here’s a little golang puzzle
Take a look at the function below that computes a mystery value for the function $f(x)$. Any idea what the function is? Take a close look at the first line where we create a channel. Notice that the channel isn’t some boring int
or string
channel. No, this is a channel of type func(int, chan int, chan bool)
. Wait what??? That’s right, this channel takes a function that takes an integer and two channels as function parameters. We define such a function, x
, right aftewards.