Not really any other way to do it, create context (i.e. struct, or stack) and have a delegate point to both it and a patch function. It'll be how partial is implemented. https://dlang.org/phobos/std_functional.html#.partial