Markus Laire skribis 2005-02-16 13:32 (+0200): > We already have +^ ~^ ?^ +| ~| ?| etc..
We have unary lc, int, etc... > Why not allow data-type prefix for the comparison operators also, so > we'd get, to mention a few, ~== (same as 'eq') ~< (same as 'lt') ~<= > (same as 'le') - and of course boolean versions ?== and ?!= (The others > really don't have use with just 2 possible values.) Why not allow lc~== (case insensitive string comparison) and int!= (integer values differ)? What about $foo length== $bar? :) > Then a programmer could write > while foo() ?== true {...} if $foo lc~== $bar { ... } > and it would be ok. After all, perl is all about giving more than one > way to do it. Yes, but I fear that if we turn every unary op into a metaop, things very quickly become very ugly. A little redundancy isn't a problem here, I think. if ?$foo == ?$bar { ... } if lc $foo eq lc $bar { ... } Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html