Switch-style condition list causes error - bug or not?

I’m helping someone else with their project, and they ran into a small issue.

First, they created a property for people:

A person can be c, p, s, re, ri or x (this is the empowerment property). A person is usually x.

Later they want some logic along the following lines (though much simplified to minimize what I have to copy here):

After jumping: if the player is: -- c: say "C!"; -- p: say "P!"; -- s: say "S!"; -- re: say "RE!"; -- ri: say "RI!"; -- otherwise: say "X."

The compiler doesn’t like that, seeming to want the various items in each condition to be people. That’s reasonable enough, so I thought the following would fix it:

After jumping: let z be the empowerment of the player; say "<empowerment = [z]>[paragraph break]"; if z is: -- c: say "C!"; -- p: say "P!"; -- s: say "S!"; -- re: say "RE!"; -- ri: say "RI!"; -- otherwise: say "X."

It does not fix it, and still won’t compile. So I suggested a different tack:

After jumping: let z be the empowerment of the player; if z is c: say "C!"; otherwise if z is p: say "P!"; otherwise if z is s: say "S!"; otherwise if z is re: say "RE!"; otherwise if z is ri: say "RI!"; otherwise: say "X."

I get the impression from the newly-resulting error message that the compiler is kind of trying to apply the property to itself to decide whether the condition is true. A different try, to see if it’s purely a matter of a misunderstanding caused by use of the temporary value:

After jumping: if the empowerment of the player is c: say "C!"; otherwise if the empowerment of the player is p: say "P!"; otherwise if the empowerment of the player is s: say "S!"; otherwise if the empowerment of the player is re: say "RE!"; otherwise if the empowerment of the player is ri: say "RI!"; otherwise: say "X."

but this still generates an error. Perhaps the whole thing hinges on how the compiler is interpreting “is” in this kind of context?

The following version does work:

After jumping: if the player is c: say "C!"; otherwise if the player is p: say "P!"; otherwise if the player is s: say "S!"; otherwise if the player is re: say "RE!"; otherwise if the player is ri: say "RI!"; otherwise: say "X."

So, my question is whether there is a good reason that any of the previous iterations didn’t work. It looks to me like what was finally accepted is the exact same logic as the original version, only not written in case-style block format. Perhaps the keyword “is” is allowed a different interpretation in an if-then-otherwise block than it is allowed in the case-style block format. If so, that seems like an inconsistency that would warrant a bug report.

Is there something more fundamental going on that I’m missing?

When you define an ad-hoc property (“a person can be X, Y, Z”) then those labels cannot be used as values. They are only defined as adjectives which apply to “person”.

If you define a kind-of-value (“A power is a kind of value. The powers are X, Y, and Z”) then the labels are values.

The inconsistency in the first case is really that you can talk about “the empowerment of the player” when that is a nearly useless expression.

Is the underlying issue that switch-style conditions only work for the “is” of identity rather than the “is” of predication, as it were? That is, when you say “The player is c” you’re not saying that the player is identical to “c” but that the player has the property of being c, so that doesn’t work in a switch statement. But once you define the powers as a kind of value then “the empowerment of the player” is actually the value c, so “the empowerment of the player is c” is an identity statement.

That looks right.

Extending switch-style conditions to the other notion of “is” would be a reasonable extension of the syntax. Then you could write code like

	[currently not legal!]
	if the foo is:
		-- a person: say "P!";
		-- a vehicle: say "V!";
		-- otherwise: say "X."

However, it would have to be compiled to different I6 code. So this is not a trivial feature.

This is… surprising, to say the least. I guess I just assumed that it was creating an unnamed (though internally enumerated) but otherwise normal value-storing property, akin to creating a kind of value and then giving the kind a property using that kind of value.

Isn’t an adjective internally a kind of selection function? If so, how is the pseudo-property stored so that the selection function can do the selection? (Or am I confusing it with “Definition:…”-type adjectives?)

And when temporary value z was created, the compiler didn’t mind to do it and even prints its value as though it is a property. What is it printing when it prints z? In other words, what does “empowerment of the player” evaluate to?

There is an internal value for each property value, but you can’t refer to it in code.