'Eval function func with arguments `*args` and `**kwargs`,
in the context of the memory.
This method works similarly to the builtin `apply`, except
that the function is called only if the cache is not
up to date.'

def eval(self, func, *args, **kwargs):

    if (self.cachedir is None):
        return func(*args, **kwargs)
    return self.cache(func)(*args, **kwargs)
