For #5 replace self_extending_list by cache_function.