Writing a phrase, with several variant forms, whose function is to follow a rule several times.

As we see in the example here, it is possible to use slashed variations in more than one place in a phrase, and to offer a number of separate forms. The main rule of thumb to remember is that value inputs for the phrase should always be separated by some text; so

To do/follow (chosen rule - a rule) exactly/precisely/just/-- (N - a number) time/times:

would cause a problem when we tried to call it with

follow the throat-clearing rule 2 times.

In general, we probably don't need to make our phrase definitions quite so flexible as this, but it's a good idea to account for "a" vs. "the", and for the possibility of using singular and plural forms, especially when writing extensions or other source to be shared.

To do/follow (chosen rule - a rule) exactly/precisely/just (N - a number) time/times:
   repeat with index running from 1 to N:
      follow chosen rule.
This is the throat-clearing rule:
   say "'Ahem,' says [a random visible person who is not the player]."
After waiting:
   do the throat-clearing rule just one time.
Instead of listening:
   follow the throat-clearing rule precisely three times.
Instead of smelling:
   follow the throat-clearing rule exactly 2 times.
Chateau Marmont is a room. Tom, Jack, Zsa-Zsa, and Wilma-Faye are people in the Chateau. Zsa-Zsa and Wilma-Faye are women.
Test me with "wait / smell / listen".
Test me with "wait / smell / listen".
Chateau Marmont
You can see Tom, Jack, Zsa-Zsa and Wilma-Faye here.


>[1] wait
"Ahem," says Jack.

>[2] smell
"Ahem," says Wilma-Faye.

"Ahem," says Tom.

>[3] listen
"Ahem," says Tom.

"Ahem," says Zsa-Zsa.

"Ahem," says Tom.