On Wed, 2004-03-24 at 13:58, Brent 'Dax' Royal-Gordon wrote: > Dan Sugalski wrote: > > At the moment I'm thinking of the load path as an array of subs that get > > passed in the file being looked for and return... something. I'm not > > sure what, though. > > Filehandles, I think. The most common case is opening a file (or > socket, or pipe, or other sort of file-like stream) and reading the > module out of there, and we can always provide a fake "string as > filehandle" PMC.
Agree. > Alternately, if filehandles can be seen as iterators (and I think they > can in Perl 6 at least), simply return an iterator that returns strings > (i.e. Iterator of String). That should handle most common cases nicely, > I think. Disagree. Strings have all of the charset/encoding mess attached, so are too high-level for loading PBC packfiles, which I expect will be the common case. (You can deliver PBCs to anyone running Parrot, without requiring that they download the compiler for your favorite language.) This does introduce the problem of how Parrot is going to determine which compiler to apply to a non-packfile library. Require shebang lines at the top to declare a language? > And I do think URIs aren't a horrible idea, although it doesn't matter > since you disagree. Ah well... Push a sub onto the load path that opens a filehandle to the URI. It's too dangerous to be in the default path, but it sounds like it will be supported for those who like living on the edge. --kag