<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cor_compile(rule, var, val, result_class, key, compilation_list):
 """ Actual compilation worker method. """

        compilation = compilation_list.get(key, None)
        if compilation:
            if isinstance(val, ListRule):
                result = []
                for itemv in val.value:
                    result.append(compilation['callback'](itemv))

                val = compilation['listclass'](result)
            else:
                val = compilation['callback'](val)
        return result_class(rule.operation, var, val)