Decorator to add new dispatch functions.

def add(self, pattern):
        """Decorator to add new dispatch functions."""
        def wrap(f):
            self.functions.append((f, pattern))
            return f

        return wrap