'Return a formula whose columns are the
concatenation of the columns of self and other.
terms in the formula are sorted alphabetically.'

def __add__(self, other):

    def _delist(x):
        if isinstance(x, list):
            return x[0]
        else:
            return x
    other = Formula(other)
    terms = (self.terms + other.terms)
    pieces = sorted([(_delist(term.name), term) for term in terms], key=(lambda x: x[0]))
    terms = [piece[1] for piece in pieces]
    f = Formula(terms)
    if _namespace_equal(self.namespace, other.namespace):
        f.namespace = self.namespace
    return f
