On Fri, Jul 15, 2005 at 02:38:22AM +0300, Yuval Kogman wrote:
> As I see it == is the generic comparison, and 'eq' is == with
> coercing parameters (in Haskell it'd be
> eq :: (Show a) => a -> a -> Bool or so... Isn't that lovely?)

There is a new generic comparison operator known as ~~.

The dispatch for ~~ is governed by MMD that acts on the type classes --
I mean roles -- of both sides.  I wonder if we can make eg:

    role SmartMatchEq {
        method sm_eq ($x: $y) { ...  }
    }
    multi infix:<~~> (SmartMatchEq $x, SmartMatchEq $y) {
        $x.sm_eq($y)
    }

Is that close to what you want?

Thanks,
/Autrijus/

Attachment: pgpcsCh4xCa7z.pgp
Description: PGP signature

Reply via email to