Example #1
0
 def __init__(self, op, *operands):
     typ = reduce(lambda a, b: xtyp(a, b) and a or None, operands)
     print "operands", operands
     print "found consensus type", typ and typ.type
     Has_Type.__init__(self, typ.type)
     self.operands = operands
     self.operator = op
     print "Operation:", str(self), Operation.__str__(self)
Example #2
0
 def __new__(cls, op, *operands):
     print "new Operation", op, operands
     typ = reduce(lambda a, b: xtyp(a, b) and a or None, operands)
     return typ is not None and Has_Type.__new__(cls) or None
Example #3
0
 def __init__(self, dest_type, expr):
     Has_Type.__init__(self, dest_type)
     self.expr = expr