Check if a list is null?

The following returns “nothing” as the output of the list:

A thing can be test. A thing is usually not test.

The void is a room.

The kitchen is a room.

An apple is in the void.

The player is in the kitchen.

To say (L - list of objects) of things that are test:
	repeat with x running through L:
		say "[a x]";

When play begins:
	say "[list of things that are test]";

Obviously if I make the apple test, it is listed properly. My question is, how do I test if the list is nothing in the To say phrase such that instead of printing nothing, it returns an entirely empty string, or just is skipped entirely?

I tried this, but it doesn’t work:

A thing can be test. A thing is usually not test.

The void is a room.

The kitchen is a room.

An apple is in the void.

The player is in the kitchen.

To say (L - list of objects) of things that are test:
	if the number of entries in L is 0:
		do nothing;
	repeat with x running through L:
		say "[a x]";

When play begins:
	say "[list of things that are test]";

I don’t think your say phrase is ever called - because the way you try to call it within the square brackets does not fit the definition in any way.
I’m not exactly sure what you want the new say phrase to do that is not already done by the built-in [list of …]-phrase?

You aren’t actually calling the phrase you defined, you’re calling the built-in one.

I think I see what you mean… but the following code is not correct, so how can I check if a list has entries? In this case, there is one list that may or may not have entries, but in the real application I am writing, this is one scenario. Another scenario may be that a list may exist for different objects, but look for the same parameters, like a list of things that are related in some way to “the noun” or “the item described”.

The code I posted here is just a simplified case to try to ask the question… I was trying to get “L” to be the list in question so that I could figure out if it has entries, and if not, return nothing (or “”), not “nothing”.

Again, this doesn’t work, so is there a syntax to do what I’m asking?

A thing can be test. A thing is usually not test.

The void is a room.

The kitchen is a room.

An apple is in the void.

The player is in the kitchen.

To say list of things that are test (called L):
	if the number of entries in L is 0:
		do nothing;
        otherwise:
	        repeat with x running through L:
		        say "[a x]";

When play begins:
	say "[list of things that are test]";

I think I figured it out, but if I got it wrong and there is some gotcha in this I don’t know about yet, please let me know:

To say list of things that are test:
	let L be the list of things that are test;
	if the number of entries in L is not 0:
		repeat with x running through L:
			if x is not nothing:
				say "[a x]";

When play begins:
        say "[list of things that are test]";

The standard rules define the adjectives “empty” and “non-empty” for lists.

How about this?

To say nonempty list of (L - a description of objects): if the number of members of L is 0, stop; say "[a list of L]".

Now you can just say “[nonempty list of test things]” or “[nonempty list of open doors]” or whatever…