After familiarizing myself with the ordinal numbers and their arithmetic, I’ve been (perhaps sloppily) using function notation to refer to certain combinations of arithmetic operations on ordinals. For example, letting
$$f(x)=x^2+\omega x$$
Gives values like
$$f(\omega + 1) = \omega^2 + \omega$$
However, I recently realized that it might be mathematically incorrect to define a function on all ordinals. Because if asked to state the domain and codomain of this function, I would have to say “the set of all ordinals”... which isn’t a set, it’s a class. And as far as I know, functions can’t be defined on classes, only sets.
Question: Is it wrong to define functions that accept any ordinal as an argument? (By “wrong”, I mean - does it lead to contradiction or paradox?)