When you make unsafe assumptions about an operator, and get bitten by it,
the *correct* conclusion should be that the assumption was wrong, not
that the language is wrong.
Well, to be fair, the assumption is not about "an operator" but
about a sequence of operators. I don't think there was any question that
"<" was not a "less than comparison" operator.
OTOH: consider
vs
5 ^ 2 [1] 25
1 < 3 < 5
Error: unexpected '<' in "1 < 3 <"
vs
? 5 ^ 2
25
? 1 < 3 < 5
True
? 3 < 5 < 1
True
? True < 1
True
vs
PS E:\UserData\Wulfraed\My Documents> 5 ^ 2
Unexpected token '^' in expression or statement.
At line:1 char:3
Unexpected token '2' in expression or statement.
At line:1 char:5
PS E:\UserData\Wulfraed\My Documents> 1 -lt 3 -lt 5
False
PS E:\UserData\Wulfraed\My Documents> 1 -lt 5 -lt 3
False
PS E:\UserData\Wulfraed\My Documents> 1 -lt 5
True
PS E:\UserData\Wulfraed\My Documents> True -lt 1
The term 'True' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:5
+ True <<<< -lt 1
+ CategoryInfo : ObjectNotFound: (True:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS E:\UserData\Wulfraed\My Documents> 'True' -lt 1
False
PS E:\UserData\Wulfraed\My Documents> 1 -lt 'True'
Bad argument to operator '-lt': Could not compare "1" to "True". Error:
"Cannot convert value "True" to type "System.Int32". Error: "Input
string was not in a correct format."".
At line:1 char:6
+ 1 -lt <<<< 'True'
+ CategoryInfo : InvalidOperation:
) [], RuntimeException
+ FullyQualifiedErrorId : BadOperatorArgument
PS E:\UserData\Wulfraed\My Documents> $True -lt 1
False
PS E:\UserData\Wulfraed\My Documents> $True -eq 1
True
Python, R, Visual Basic 6, PowerShell 2, respectively.
Obviously, someone coming over from VB or R who hasn't read the
Python reference is going to wonder why they are getting incorrect
results when doing exponentiation (Isn't there an interface from Python
to R? Now there is confusion in the making!)
{Hmmm... R accepts BOTH 5 ** 2 and 5 ^ 2 for exponentiation}