Mehmet Yavuz Selim Soyturk wrote:
We could maybe assume that the ordering is well defined between the
instances of a PMC class. But cmp needs to compare instances of
different PMC classes as well, for which a well defined ordering is
less probable.

I would not be surprised if in some dynamic language all of a==b, a<b
and a>b evaluate to false if a and b are of different types.
Yup. To be able to implement Perl 6's cmp as an MMD method on the junction, the ability to return a PMC as well as just a -1, 0 or 1 would be handy. Otherwise we just special case the implementation of the <=> and cmp operators to get junctions to thread through them. As you say, it would be useful for other languages that want to hand back an undefined value or something too. So perhaps a general mechanism is a good thing.

say $allison.thoughts; # por favor :-)

Jonathan

Reply via email to