Larry wrote:

And you get the C || and && for free
Yeah, but it's the same sense of "free" in which spam is "free".
You pay for it in other ways.


But distinguishing int ops from str ops fixes the really nasty rule
in Perl 5 that says "If this value (these values) has (have) ever
been used in a string context..."

Or was it a numeric context?  I can't remember.  And hey, if I can't
remember...
<grin>

However, I think a better fix is to default the bitwise ops to numeric,
unless both args are *currently* strings. And the unary ~ and + makes it
easy to be sure when you're not sure:

	+$x .| +$y	# definitely bitwise OR
	~$x .| ~$y	# definitely charwise OR


If one were going to generalize that, one would be tempted to go the Ada
route of specifying the radix explicitly:

	0123		# decimal
	2:0110		# binary
	8:123		# octal
	16:123		# hex
	256:192.168.1.0	# base 256
Amen!

Damian

Reply via email to