2 ms·
Does is actually extend the class or simply wrap it with a decorator? I think Groovy takes this approach but I could be wrong.
by xtho 16y ago
Does is actually extend the class or simply wrap it with a decorator? I think Groovy takes this approach but I could be wrong.
- chousuke 16y agoIt does neither. The dispatch logic is on the protocol side, which can be modified. When a class is extended, the protocol function is changed to have an extra instance check. (I don't understand the details in full, though. You'll need to ask Rich Hickey) AFAIK there is also some kind of caching involved to improve performance.