lexically scoped resource management
