Can't variables be used within generic function methods? (CLOS/LISP)
|Added at||2017-01-05 00:01|
I'm learning about generic functions in CLOS.
Because of the type of examples I find in textbooks and online, I'm getting very confused. The examples always use the fact that there is multiple dispatch. Based on the argument type, a different calculation is performed. However, why are the arguments themselves never used in the examples?
In the examples above, you can see the methods themselves never actually use the
Also, it's written on Wikipedia:
Alright, so methods do not have a "this" because they do not belong to a class. But why can generic-function methods have a receiver then? Isn't the receiver similar to the 'this' in a class?