Regardless of whether you use the option ‘Use the serial comma’ or not, Inform will parse these commands:
[code]>take A, B, C
take A and B, C
take A, B and C
take A and B and C[/code]
but not this one:
>take A, B, and C
Which is, as far as I can tell, because it thinks that the third item on the list is something called ‘and C’. I’d never enter a command like this (for which I’d like to thank my parents, Ayn Rand and God), but a substantial number of my American testers – including experienced IF players – do it this way first, sometimes assuming that if that doesn’t work for a given verb, that verb won’t work on multiple objects.
I’m guessing that the way around this would involve tampering with the player’s command; is replacing “, and” with “,” going to cause problems in some other legitimate command phrasing that’s not occurring to me?
This is a feature request – and I’d say it ought to be given a high priority. There is simply no way that a command in that form should fail to be understood.
Bug or feature request, it’s been in the Inform parser for nearly twenty years. (I just tested Curses.) I think this is the first I’ve heard of it. Maybe we could call it a medium-high priority.
Yeah. The only reason that it’s coming up at all is that this particular game has a relatively high number of multiple-object verbs, which the player will use a lot, but not necessarily with ALL. If I’m doing weird things with I7, I expect to have to do weird fixes.
if the player's command includes ", and" begin;
replace the matched text with ",";
end if;
because you’re not allowed to use ‘understand’-type phrases with anything containing punctuation that’s already used by the parser (.,!?:
After reading a command (this is the strip serial comma rule):
if the player’s command matches the text “, and” begin;
let comma be indexed text;
let comma be the player’s command;
replace the regular expression “, and” in comma with " and";
change the text of the player’s command to comma;
end if.
The Testing Room is A Room. A peach, a plum and a banana are in the testing room.
Test me with “take peach, plum, and banana / drop peach, plum, and banana”.[/code]
This seems to work fine.
Well, from what I recall, something is idempotent if and only if any positive exponent of it is zero.
Yeah, but I was afraid that “identity” was either reserved in I7 somehow or that someone might want to use it elsewhere in the code; I wanted to use a name that I was pretty sure wouldn’t result in namespace clashes.
Is there another way to do the thing I was doing?
(climbingstars – idempotence can mean somewhat different things in different contexts, but for instance an idempotent function is one such that f(x) = f(f(x)) for every x. Multiplying by zero is idempotent because no matter how many times you do it it comes out zero.)
I’m not sure I want to think about the thing you were doing. Best to leave it as it is, possibly with a clown-hat on it so that people will have fair warning…