i am guilty of having done that. but you do have a point. although, it IS useful to create singleton objects:
The function as such is not my gripe. It's the way it's hooked into the cast operation. There's no natural mapping between strings and objects, as it is between e.g. the integer 1 and the string "1". If anything, it'd be slightly more natural to interpret the string as pike code and compile it.
the describe_functions are not generic, means, i'd have to do multiple tests, and it still does not make it any easier to get the type.
If you want the type then that's exactly what _typeof gives you. No sprintf'ing and no scanning needed. I don't understand what you want.
master()->objects[object_program(Stdio)]; should have done the trick. i am puzzled why that does not work.
Ah, yes, dirnodes and joinnodes don't end up there, only "proper" module objects. The fc mapping is better:
master()->fc_reverse_lookup (Mapping);
(1) Result: "/home/mast/Pike/stable/lib/modules/Mapping"
master()->fc_reverse_lookup (Stdio);
(2) Result: "/home/mast/Pike/stable/lib/modules/Stdio"