# New Ticket Created by  dakkar 
# Please include the string:  [perl #126000]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126000 >


Given this code::

  {
    class Foo { has $.x }

    multi sub infix:<eqv>(Foo $a, Foo $b) {
      say "won't get called";
      $a.x eqv $b.x
    }
  }

  multi sub infix:<eqv>(Foo $a, Foo $b) {
    say "will get called";
    $a.x eqv $b.x
  }

  my @a = Foo.new(:x(1));
  my @b = Foo.new(:x(1));

  say @a[0] eqv @b[0];
  say @a eqv @b;

the output is::

  will get called
  True
  False

because:

- the first ``eqv`` definition is not visible to any of the calls
- the second ``eqv`` definition is not visible to the
  ``infix:<eqv>(@a,@b)`` in the setting

This means that:

- ``eqv``s defined in other packages are never used
- adding a ``eqv`` for users' types is not very useful, since they
  won't be called most of the time

Should there be some mechanism like ``ACCEPTS`` to make ``eqv`` more
useful?

Should there be a mechanism to add ``multi`` candidates dynamically?
  
-- 
        Dakkar - <Mobilis in mobile>
        GPG public key fingerprint = A071 E618 DD2C 5901 9574
                                     6FE2 40EA 9883 7519 3F88
                            key id = 0x75193F88

You have only to mumble a few words in church to get married and few
words in your sleep to get divorced.

Reply via email to