Open rakudrama opened 11 years ago
Set owner to ngeoffray@google.com. Added this to the Later milestone. Removed Priority-Medium label. Added Priority-Low label.
Added TriageForM5 label.
Removed TriageForM5 label.
Removed this from the Later milestone. Added Oldschool-Milestone-Later label.
Removed Oldschool-Milestone-Later label.
I think the default and specialized getInterceptor functions would be better named as 'methods' or 'getMethods'.
Also, it would be better if 'Object' was included in the name of the specialized versions that can dispatch to Object.
For example, this looks like it works on String and num, but also works on Date and Duration in the program this was extracted from. Adding 'Object' to the name will help:
$.Comparable_compare = function(a, b) { return $.getInterceptor$JSStringJSNumber(a).compareTo$1(a, b); };
$.getInterceptor$JSStringJSNumber = function(receiver) { if (typeof receiver == 'string') return $.JSString.prototype; if (typeof receiver == 'number') return $.JSNumber.prototype; return $.ObjectInterceptor.prototype; };
Although we don't do it yet, I think there are circumstances where it is possible to generate faster specializations where there is no Object fallthrough - there would be one less test.