develooper Front page | perl.perl6.internals | Postings from February 2001

Re: PDD 2, vtables

Thread Previous | Thread Next
February 7, 2001 12:07
Re: PDD 2, vtables
Message ID:
Dan Sugalski wrote:
> Splitting the vtable into two pieces, with one piece not tied to a PMC,
> makes some things impossible. Consider this:
>    @foo = @bar * @baz;
> where all three arrays are really matrix types.

By the PDD's notion of `key', what would be the `key' of a matrix type ?

(I think that's actually a -language question, but) What $foo[42] (where
@foo is matrix) would compile to?

> In the separate load/store
> and do vtable scheme it means you get the value of @bar and @baz in scalar
> context, and multiply the results. Two operations, and the resultant
> are sanitzed. In the single vtable scheme, we'd execute @bar's multiply
> routine, which would be clever enough (because we wrote it that way) to
> the second parameter's also a matrix, and do matrix math.

Actually, not necessarily. It depends of what the compiler does... There
could be special entries for array operations, like +/-/*/... . The problem
I see with it is what happens when you @a = @b. Actually, if @b is a matrix,
@a = @b makes @a a matrix or evaluates @b in list context? What about @a =
(@b) ? What if @a is a tied array? This matrix thing is actually getting
very confusing to me... I think all these proposed additions to the language
should be carefully examined for possible mis-interpretations like these.

- Branden

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About