Thanks, vaporware. The actual rule I was working on is a bit more complex than the example I posted above, but due to your suggestion I was able to get everything working as intended. While pre-testing various methods using the example above, though, I ran across the following odd if not outright buggy behavior (in case anyone wanted to use the example above for anything):
a) Writing the “Report smelling a room” rule this way:
Report smelling a room (called the waftarea):
let waftlist be a list of things;
repeat with wafted running through things in the waftarea:
unless the number of characters in the currentpungency of wafted is 0:
add wafted to waftlist;
if the number of characters in the aroma of the waftarea is not 0:
say "[aroma of the noun][unless waftlist is empty][paragraph break]You can also smell [waftlist with indefinite articles] here.[otherwise][line break]";
otherwise if the number of characters in the aroma of waftarea is 0:
say "[unless waftlist is empty]Apart from [waftlist with indefinite articles], y[otherwise]Y[end if]ou don't smell anything unusual in this area.".
gives the unexpected (to me, since the "currentpungency of the player is “”–the same as the marble) result:
testarea
You can see a marble here.
smell
Apart from yourself, you don’t smell anything unusual in this area.
b) Writing the “Report smelling a room” rule this way:
Report smelling a room (called the waftarea):
let waftlist be a list of things;
let samplewaft be indexed text;
repeat with wafted running through things in the waftarea:
change samplewaft to the currentpungency of wafted;
unless the number of characters in samplewaft is 0:
add wafted to waftlist;
say "=[samplewaft].";
if the number of characters in the aroma of the waftarea is not 0:
say "[aroma of the noun][unless waftlist is empty][paragraph break]You can also smell [waftlist with indefinite articles] here.[otherwise][line break]";
otherwise if the number of characters in the aroma of waftarea is 0:
say "[unless waftlist is empty]Apart from [waftlist with indefinite articles], y[otherwise]Y[end if]ou don't smell anything unusual in this area.".
results in the same behavior as (a), namely:
testarea
You can see a marble here.
smell
Apart from yourself, you don’t smell anything unusual in this area.
with the additional very unexpected (to me) result that if we add a line in the repeat loop to print the current content of the temporary “samplewaft” token, the test game crashes with a P32 “Attempt to use a property of nothing” error after typing the command “smell”.
c) After the above two failures, the following unexpectedly (to me, under the circumstances) worked just fine when substituted for the “Report smelling a room” rule given in the example:
Report smelling a room (called the waftarea):
let waftlist be a list of things;
let samplewaft be indexed text;
repeat with wafted running through things in the waftarea:
change samplewaft to the currentpungency of wafted;
unless the number of characters in the currentpungency of wafted is 0:
add wafted to waftlist;
if the number of characters in the aroma of the waftarea is not 0:
say "[aroma of the noun][unless waftlist is empty][paragraph break]You can also smell [waftlist with indefinite articles] here.[otherwise][line break]";
otherwise if the number of characters in the aroma of waftarea is 0:
say "[unless waftlist is empty]Apart from [waftlist with indefinite articles], y[otherwise]Y[end if]ou don't smell anything unusual in this area.".
giving the originally intended result:
testarea
You can see a marble here.
smell
You don’t smell anything unusual in this area.
This seemed strange at first since, on casual examination, we make a temporary text variable called “samplewaft” and then don’t explicitly do anything at all with that variable, resulting in a changed consideration by Inform of the way the “currentpungency” text is handled. It is what it is, I guess.