I have a feeling I'm missing something very clever

VSarkiss on 2006-07-07T16:43:06

Hm. I like reading the "This week on p5p" summaries, and I usually understand the conversation. This one looked like something really clever was going on, but I didn't get it all. (I know C, but not XS.) The MMD in the name makes me think of multi-method dispatch, but I don't see how it fits. Clarification, anyone?


Changing Method Lookup

chromatic on 2006-07-07T18:20:15

You can fake multidispatch in Perl 5 right now by writing a little wrapper in Perl that checks the arguments and redispatches to the right multi-variant.

This just pushes that check to the C level by redefining the method lookup opcode. The code doesn't actually redispatch, but it demonstrates that it is possible to override opcodes.