One writes ordinary generic functions, and then optimized typed methods in lisp like this:
(defgeneric xplusone (x) (1+ x))
(defmethod xplusone ((x integer)) (1+ x))
(defmethod xplusone ((x double-float)) (1+ x))
The sbcl compiler (called python) even creates the typed methods by itself, so mostly the defgeneric line is enough.
The type hints for args and return types are purely optional, as the compiler figures it out by itself.He is right that algorithms, methods, trump data structures, objects. You always write methods with specializations on objects. Not the other way round, classes with specific methods.