On Tue, 8 Aug 2000, Ken Fox wrote:
> Chaim Frenkel wrote:
> > Have every Package generate a vtbl for each subroutine in the package.
> > Then when something is blessed into the package ...
>
> > I wasn't discussing the core. Rather a possible optimization of
> > method lookup.
> >
> > At any time only for any method name only a single version can be
> > called (at the invocation point) so why not precompile it.
>
> I think we've only talked about internal method dispatch used to implement
> the core OPs. The dispatch tables won't be user (Perl code) extensible.
> It should be possible to use the dispatch tables to easily implement
> overloading because operators should map fairly easily into the table.
I've been considering adding all the 'basic' operations (simple math,
repetition, maybe comparisons) into the base vtable. That'd mean that,
while the core perl might have *no* idea what to do with:
@foo = @bar * 12;
the slots would be there in case the clever PDL folks want to define it.
Or any clever folks, I suppose. I have no idea what multiplication in list
(or would it be array? Probably actually array context, though we don't
have that at the moment) context does, but someone else might.
> Anyways, method lookups are already table driven so in theory they should
> be as fast as the vtables we're talking about for the core.
If we get cleverer than perl 5, they should be darned close.
Dan