On Fri, Jul 15, 2005 at 10:01:43 +0800, Autrijus Tang wrote: > 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 ~~.
~~ is just Eq, there is also Ord, and Show, and a multitude of other
things, which are more of a cultural issue.
s
> 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?
Well, we'll need useful MMD for that to work =/
--
() Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418 perl hacker &
/\ kung foo master: *shu*rik*en*sh*u*rik*en*s*hur*i*ke*n*: neeyah!!!!
pgpMgLF5CDjvS.pgp
Description: PGP signature
