Doesn’t “If the weather is raining or the weather is snowing or the weather is hailing” work? The problem isn’t that you can’t have more than two or-clauses, it’s that you have to write out the subject every time – you can’t use “or” to join the values.
It’s not completely unheard of in my experience but it is extremely rare in any programming language to be able to use ‘or’ in that way. One of the cases I guess where Inform follows suit instead of breaking with tradition.
However, it seems like it should be uniquely (or at least unusually) possible for Inform to implement this kind of grammar. Most languages have to avoid it, because they can’t resolve the ambiguity – do you mean the ‘or value’ to add to the list of previous values, or do you mean to test the ‘truth state’ (i.e. interpret it as a binary value) on its own? The latter provides an incredibly useful loophole to help write simultaneously complex and compact if conditions. Wouldn’t want to close that.
But Inform doesn’t have this loophole to begin with because you can’t test variables as truth states (I don’t think). You have to rephrase it as a ‘whether or not’ to get an actual truth state out of a conditional statement, and I think the same goes for variables. I don’t remember i7 ever accepting something like ‘if carrying capacity, say “It can hold things.”’
So there is no danger of ambiguity and it seems like going for the more fully featured use of ‘or’ that is unavailable to most languages, would be a win.
Yes indeed, that will definitely work. And thanks for mentioning it–I took the OP’s statement that “a series of if statements would be too clumsy” to be explicitly rejecting this approach, but I’ll bet that in fact it’s exactly what he was looking for.
But it would be nice to also have an adjectival value, like so (except, you know, in a way that actually works):
Weather is a kind of value.
A room has a weather.
A room can be adverse.
A room is adverse if the weather is raining, snowing, or hailing.
Instead of going in an adverse room, say "I'm not going outside in that!"
Complicated because it would be better if the “adverse” value itself had three states instead of two (three being the largest set that can be divided up in any way by including or excluding a single element):
A room can be pleasant, neutral, or adverse.
A room is pleasant if the weather is sunny. A room is adverse if the weather is raining, snowing, or hailing.