Well, *that* was certainly an interesting evening of emails to wade
through tonight.
On Fri, 25 Aug 2000, Dan Sugalski wrote:
> Bingo! That's it in a nutshell. And every single thing that could possibly
> need to be figured out would be done ahead of time so there's as little
> overhead as possible. (I'm even pondering the possibility of jamming the
> table with the potential functions and their associated information into a
> shareable image so we don't even need to parse a text file--it's already
> predigested and available)
>
Picking a random entry location for some -internals work, and Dan's post
wins.
To expand (or condense) a couple of other suggestions (read
these with an implicit question mark on the end) - perl should have a
master index that it reads in on startup. This index would/could
contain easy-to-digest locational information for perl - a combo
super-stash and manifest, all-in-one.
It would record something like.... (only, of course, this is English):
CODE,grep,CORE,{other info?}
CODE,cos,Math::Trig::cos,{other info?}
PACKAGE,Math::Trig,/usr/local/perl/lib/.../.../.../Trig.so,1.2
OTHER TYPES?
Perl does a quick look-up here for (unresolved symbol) package
determination (and maybe quick package location resolution, etc, etc.)
which it would pull-in automagically. (Run-time overloading of
opcodes?)
Modules could define what functions, etc, would be manifested, which
would ultimately be a make arg. (As you don't want to throw
*everything* in the manifest.) The base functions from Perl 5 would be
manifested during the Perl 6 build automatically. Later versions,
modules, etc, could overwrite the manifest/index to force a new version.
(Which could be very fuggly later on in life.....)
package Math::Trig;
...
@INDEX = qw/sin cos tan asin acos atan/;
...
1;
Whammo 34> make install
Installing Math::Trig to /usr/lib/perl/.../.../.../
(but no manifest, so use Math::Trig would be required.)
Whammo 35> make index
Updating /usr/lib/perl/plidx.so with Math::Trig
Auto-use for sin cos tan asin acos atan.
And later.
package MyMath::Trig;
...
@INDEX = qw/sin cos tan/;
...
1;
Whammo 334> make install
Installing MyMath::Trig to /usr/lib/perl/.../.../.../
(but no manifest, so use MyMath::Trig would be required, and a simple
'sin' or 'cos' would invoke the Math::Trig versions.)
Whammo 335> make index
Updating /usr/lib/perl/plidx.so with MyMath::Trig
Auto-use for sin cos tan.
So now a bare 'sin' or 'cos' would invoke MyMath::Trig::sin or ::cos,
but still leave Math::Trig::atan and ::asin.
A 'use Math::Trig' or 'use MyMath::Trig' would follow the regular rules
of exporting, etc. (No export, look for the default.)
There are a couple other uses I can think of something like this for,
but the grand question is.....
Is this (what|one of the things) we're talking about?
--
Bryan C. Warnock
([EMAIL PROTECTED])