develooper Front page | perl.perl6.language | Postings from July 2006

Re: ===, =:=, ~~, eq and == revisited (blame ajs!)

Thread Previous
From:
Yuval Kogman
Date:
July 12, 2006 09:37
Subject:
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
Message ID:
20060712163648.GO19536@woobling.org
If we do have deep value equality checks, then "default" == and eq
are probably:

	sub &infix:<==> ( $x, $y ) {
		+$x === +$y;
	}

	sub &infix:<eq> ( $x, $y ) {
		~$x === ~$y;
	}

So that the compare-as-sometype behavior is retained from perl 5
without introducing new complexity to the objects being compared as
strings/numbers.

-- 
  Yuval Kogman <nothingmuch@woobling.org>
http://nothingmuch.woobling.org  0xEBD27418


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About