Test Chamber is a room.
The portrait is a container in Test Chamber. The indefinite article is "a".
The safe is a closed openable container in the portrait. The printed name of the safe is "safe2". The safe is proper-named.
The apple pie is an edible thing in the portrait.
The hat is a wearable thing in Test Chamber.
The table is a supporter in Test Chamber.
Rule for printing the name of the portrait while listing contents of a room:
say "portrait (which concealed [if portrait contains nothing]nothing[else][a list of things in portrait including contents][end if])";
omit contents in listing.
Test me with "x portrait / take portrait / i / put portrait on table / l / x table / take all from portrait / l / take portrait / i / x portrait / drop portrait / l / take hat / put hat in portrait / l".
A similar alternative is:
Rule for printing room description details of the portrait:
say " (which concealed [if portrait contains nothing]nothing[else][a list of things in portrait including contents][end if])";
omit contents in listing.
This second rule will trigger under more circumstances than the first (see the output of “x table” in “test me” for the two different rules). Depending on the details of your game, you may want to relax the first rule’s constraint (while listing contents of a room -> while listing contents).
Strangely, without the line that explicitly sets the portrait’s article, the first approach causes the article “an” to be chosen for the portrait if it contains an apple pie. However, if I change the apple pie to a papple pie, the article “a” is selected instead.
Vince, what version are you using? That sounds kind of like a bug involving indefinite articles that was fixed in 6L02… but in any case it sounds like a bug, which you should file.