There might be a bug in operator priority in Inform 6 compiler, but I’d rather post about it here than on github/gitlab, in case it’s just my tired brain… (It seems odd to me that a bug like this, on operator priority / logical expression parsing, would have stayed in there for that long…)
These expressions should be, I think, logically equivalent :
(~~(location == Cove or Centralplaza) && lookmode == 1)
(~~(location == Cove || location == Centralplaza) && lookmode == 1)
((location ~= Cove && location ~= Centralplaza) && lookmode == 1)
But when I’m at the Beach location with lookmode = 2, the first two expressions are true, when they really shouldn’t. (The DM4 seems to endorse that usage, since page 484 there is “if (~~stop) && digits <= 3)”).
And then when I try permuting the order:
(lookmode == 1 && ~~(location == Cove or Centralplaza))
(lookmode == 1 && ~~(location == Cove || location == Centralplaza))
(lookmode == 1 && (location ~= Cove && location ~= Centralplaza))
They’re all false, as they should be.
What’s going on?