News for hackers. Stuff that matters.
Re:"DCI" in Ruby is completely broken by perlgeek on Wednesday January 02, 2013 @12:08PM (#4997677)
Erm what? Changing the class hierarchy invalidates all method caches? That sounds a bit brutal, and totally unnecessary.

Can't you just have a method cache per metaclass (or class; I'm not very familiar with how Ruby factors this stuff)? Since mixing in a role into an instances creates a new metaclass anyway, there's no need to affect instances of the original class.

Re:"DCI" in Ruby is completely broken by FooBarWidget on Wednesday January 02, 2013 @12:20PM (#4997752)
It's because MRI's implementation is simple. They haven't bothered caching per class because it takes more code. However JRuby caches per class.
Re:"DCI" in Ruby is completely broken by enebo on Wednesday January 02, 2013 @12:30PM (#4997826)
If you have to go and look up the method again (even ifcached) because the callsite cache is invalid then you already lost. Constantly invalidating the callsites is the real problem with this pattern.