>What do you mean by that?"m" is a method in class A,
"m" is a (different) method in class B.
Each method is tied to only one class. While in CLOS i can do the following:
let's say i have class Vehicle -> subclasses Spaceship and Car
then i have class Person
i can define, for example, the method "drive" two times:
drive (Spaceship, Person)
drive (Car, Person)
Method "drive" is not tied to Spaceship nor Car. The class definition for Spaceship or Car does not include the definition of "drive". "Drive" is a method that is applied over the combination of two objects. "Drive" is not specific to a class, but to a
combination of two (or more) classes.
To put it in another way,
drive (Spaceship, Person)
is
not¨ "a method of the Spaceship class that takes a Person as an argument". It is: A method that works for the combination of Spaceship AND Person.
Thus if i call the method "drive" and pass it two objects (a,b) , the language will check if there is an implementation of "drive" for the specific combination of class-of "a" and class-of "b" and apply the correct method.
CLOS also allows, for example, doing other interesting stuff, like, for example, if we have method "xxx" and when we call method "xxx" with some objects as arguments, there is more than one method that could apply, i can also configure things such as:
a) all methods are called and the results of all methods are collected in a list
b) the maximum of all results is used
c) the minimum
etc etc (you can define your own behavior)
This is called "method combinations".
There are much more features as well. For example, on your code you can specify the code that should execute whenever any vehicle is driven by a person; also, in separate, the code that should execute when a person drives a Spaceship, and also some piece of code that should be executed after any kind of vehicle is driven. These three methods aren't tied to a particular class definition, and will be called accordingly with just one line of code that calls the method "drive".
The point to all these features is that they allow mapping your problem domain to OOP in an easier way, because the language's limitations do not get in your way. You directly tell the OOP system what do you want it to do; there's less need to do workarounds.
My explanation, of course, is weak compared to the excellent explanation/tutorial here:
http://www.gigamonkeys.com/book/object-reorientation-generic...