Inform: && and || precedence test.


Mon, 28 Aug 1995 16:29:08 -0500

I can't recall from an earlier post (The postings here expire quickly)
if Gareth or Graham ever said && had precedence over ||, but it does. I
used a simple test in Inform:

if (player == player || player == player && player ~= player)
print "&& has precedence.^"; else print "&& and || have equal prec.^";

Basically TRUE OR TRUE AND FALSE will evaluate to TRUE in any good
language, and will eval to FALSE in any stupid language that doesn't
follow logical standards. :)

-- 
--- Sam Hulick ------------- shulick@indiana.edu ---------------------
Systems Consultant        | Homepage:
Indiana College Placement |    http://copper.ucs.indiana.edu/~shulick/
  and Assessment Center   | PGP public key available on request