section 8.6 using macros to manage resources