Macrofied higher-order functions for method definition.