Luke Palmer <[EMAIL PROTECTED]> wrote:
> I was uneasy when the C<num_eq> and C<str_eq> vtable entries were first
> proposed.  Sure, they get the job done for Perl 5, but Perl 6 is
> expanding its notion of context beyond those compiled in.  You're
> supposed to be able to add, say, "nontransitive ring" context if you
> want.

When adding a "nontransitive ring" that has to be expressed in terms of
existing PIR. Context handling is up to the HLL compiler.


>     num_eq $P0, $P1, foo
>     str_eq $P0, $P1, bar

> Becomes

>     context .NUMERIC
>     eq $P0, $P1, foo
>     context .STRING
>     eq $P0, $P1, bar

> This works efficiently since context often propigates inward, as in:

Doubling opcodes isn't efficient. The Perl6 compiler has to know the
context, so it can emit the correct compare opcode.

> Luke

leo

Reply via email to