Global scope function to call appropiate class for execution


#1

Is it possible to have a global scope function, which when called, according to type matching, it will deliver the task to the class, according to that type. Or as an overriding of the global function?

I though about that, since if it is possible, so technically I can create new prefix operators. That is, if, for example, +a is equivalent to +(a).


#2

What do you mean by “global scope function”? Scala doesn’t allow methods in the global scope…


#3

Is it possible to create a new Predef methods?