the replacement value as a function

The replacement value could be a function that provides a value