def primitive(self, receiver, context, m, method, *args): method = unicode(method.eval(context)) args = [arg.eval(context).value for arg in args] if hasattr(receiver, method): return getattr(receiver, method)(*args) raise AttributeError("{0:s} has no attribute {1:s}".format(receiver.type, repr(method)))
def requires(self, receiver, context, m, *methods): receiver.requirements.extend( list((runtime.state.frommio(method.eval(context)) for method in methods))) return receiver