On Sun, 28 Jul 2002, Nicholas Clark wrote: > On Sat, Jul 27, 2002 at 08:07:50PM -0700, Sean O'Rourke wrote: > > Whether plain cmp (as a vtable function or an op on PMCs) should be kept > > at all is questionable -- there's no way to get at it syntactically from > > would be a regexp match. In effect =~ would be a builtin cmp with dispatch > based on the types of both sides, preferring to compare as integers, then > floating point, then strings, then regexps, then ... > > But even if perl6 wants this (and I can't remember if it's been officially > suggested that it might), I'm not convinced that it's something that needs > a vtable entry in the low level types of every PMC.
I would also guess that this logic will end up at a higher level, whether figured out at compile time or in some non-vtable method at runtime. And actually, the smart-match table in A4 doesn't mention anything for object types, so I'm not sure where this one is headed. In any case, =~ doesn't say anything about ordering, whereas cmp() does, and we already have an unordered is_equal() vtable method that will cover =~. /s