General purpose macros for scala