I suggest you ...

(Programming) Inclusion of OR in conditions

As in the Inform 6 code

if (a == 2 or 4 or 6) ...
if (leader ~= bill or martin or fred) ...

Which might be syntactically rendered in I7 as, say:

if a is either 2 or 4 or 6...
if the leader is neither Bill nor Martin nor Fred...

This should work with all verbs, so that we could have, e.g.

if the player is carrying either a knife or a sword...

A variant with positive "and" conjunctions would also be welcome:

if the player is carrying both the flint and the steel and the firewood...

And if it worked on the left hand side too, then all the better:

if either the dragon or the troll is on the bridge...

We would have to watch out for over-complicated, ambiguous sentences
though:

if the player is carrying either a knife or a sword which is made of
either steel or bronze or a spear or a halberd...

And allowing these constructs on both sides would be difficult:

if both the large door and the small door are either open or broken...

7 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    emshortAdminemshort (Admin, Inform 7) shared this idea  ·   ·  Admin →
    under review  ·  emshortAdminemshort (Admin, Inform 7) responded  · 

    We agree that this would be nice, but the implementation problems make us want
    to hide under the bed. (The word “or” is already used for selection between
    actions, and the ambiguities pile up.) We’ll keep this under review.

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Eric EveEric Eve commented  · 

        Half a loaf would be better than no bread at all here. Even if only the first part of this suggestion is implemented (if a is either 2 or 4 or 6...
        if the leader is neither Bill nor Martin nor Fred... ) it would be useful. Currently this functionality is (more or less) provided by my Alternatives extension, but it would be nice to have something a bit more generalizable.

      Feedback and Knowledge Base