Some digging reveals that that is very old code, probably from the dark confused ages.
Sounds likely.
From ulpc/lib/master.lpc:
| object cast_to_object(string oname) | { | object ret; | | if(oname[0]=='/') | oname=combine_path(getcwd(),oname); | | if(oname[sizeof(oname)-3..sizeof(oname)]==".lpc") | oname=oname[0..sizeof(oname)-4]; | | if(ret=objects[oname]) return ret; | | return objects[oname]=clone(cast_to_program(oname)); | }
I think it'd be more natural if fc would contain the straight paths, without any suffix chopping. That way there are only two things: Either a name in the module namespace or a path in the filesystem (or possibly a relocated path if PIKE_MODULE_RELOC is enabled). No tricky intermediate varietes. Am I reasoning too simplistic? Is there a reason to chop off the suffixes in this case?
I guess it has to do with the relaxed filename handling in handle_include() et al, that accept filenames without extension.