We have vtables for "shr"/"shl" but not for "lsr". Is there a specific reason that these vtables are not in pdd02?

The same is with "pow", though this could be treated like the trigonometric ops, which we don't have for PMCs either.

BTW: What about trig ops for PMCs:

sin P1, P0 # no vtable, so ...

  set N0, P0   # 2 more ops to convert
  sin N1, N0
  set P1, N1

or
  op sin(in PMC, in PMC) {
    double n0 = VTABLE_get_number(interp, $2);
    double n1 = sin(n0);
    VTABLE_set_number_native(interp, $1, n1);
  }

or

  trig P1, P0, "sin"  # implemented as method in PerlScalar or ...
  trig P1, P0, .PERL_SCALAR_SIN_METHOD

C<trig> would use C<find_method>. The latter with an array-lookup/integer index (if find_method uses an OrderedHash as method table).

leo



Reply via email to