introduce with_cache_variable to cache block results in ivars