Expanding slightly on this a little bit I wrote two generic gists demonstrating this in getter and setter fashion.
Here we simply replace the function with another function that returns the initially given value.
The setter example is a bit more complex. In order to correctly scope the passed function we create a copy of it, substituting the current context.
This context can even be altered externally by binding