An interactive fiction by Juhana Leinonen (2008) - the Inform 7 source text
Swimming in is an action applying to one thing.
Understand "swim" as swimming in.
Understand "swim in [something]" as swimming in.
Should the game choose swimming in a liquid:
it is an excellent choice.
Check swimming in:
if the noun is a container:
if a random thing in the noun is not a liquid:
say "There's nothing in there to swim in and it would be too small anyway.";
say "It's too small to swim in.";
otherwise if the noun is not a liquid:
say "That's not liquid!";
say "There's not enough of it to go swimming in.";
stop the action.