ah, nice. what about type checking?
Not sure. I suspect the two identifiers would have their own types, so they wouldn't have to be identical. (But they'd have to be identical when it comes to runtime types.)
And besides, lugging around variables in every object containing the same function pointers isn't exactly pretty.
how is that different from lugging around the wrapper function?
The wrapper function remains in the class, which means a lot less lugging around.
well, except in the case of lib/modules/Calendar.pmod/Timezone.pmod is the if(names) check (which now happens every time) faster/better than the variable lookup?
In that case my motivation was partly to enhance readability, actually. From a performance perspective, I believe that the extra "if (names)" check brings it about even with the variable approach.
hmm, if constant would take a type (constant function `-> = `[];) would that help the compiler to accept `[] as a constant expression?
No, that's not related. Pike always resolves the type of the value at compile time for constants, so the type of the constant itself would only be used to check that the value is compatible.
also, is that specific to `[] similar functions or does that problem exist with any function?
It exists with any function.