replaces MACRO with lambda