Utilities for macro writers