| Say I want to make a subclass of a list. I can annotate a list with my class name and overload functions on it via redef or defm, but I won't be able to get the inheritance. If I try to give it a function for lists, it won't understand it. The most direct way to get around this is to look on up the annotation chain. That is: (redef isa (ob class)
(or (old ob class)
(let repr (rep ob)
(unless (is repr ob)
(isa repr class)))))
The only problem with this is that there might be a situation where you don't want inheritance. For example, 1 is always an int, no matter how it's tagged, and functions on ints will always work on it. How would one get around this? |