On 6/30/2012 23:45, Evan Driscoll wrote:
> You may also
> want to put Java in there as well, as < is effectively not commutative
> in that language. (I didn't try C#.)

I guess you could actually put Lua and Ruby into the roughly same
category as Java too.

But things get a little nastier in ==, as 'false == false == false'
evaluates as '(false == false) == false' to 'false' in Java and Lua.
(Ruby produces a syntax error for this, roughly the Haskell approach.)

But we have Javascript:
  1 < 1 < 2
  => true
  false == false == false
  => false

O'Caml:
  # false == false == false;;
  - : bool = false
  # 1 < 2 < true;;
  - : bool = false

Java:
  System.out.println(false == false == false);
  (outputs) false

Lua:
  > print(false == false == false)
  false

C and C++:
  std::cout << (1 < 1 < 3) << "\n";
  (outputs) 1
  std::cout << (false == false == false) << "\n";
  (outputs) 0

Evan

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to