Question in brief: For what challenge types and in what circumstances should code that requires a REPL be acceptable in an answer?
There seems to be an understanding in chat that code that only works in a REPL is not valid as an answer, but I can't find any consensus here on meta to back this up, which makes it difficult to comment to that effect on REPL answers.
I've found these two somewhat contradictory posts:
Default for Code Golf: Program, Function or Snippet?
and this answer elsewhere:
Loopholes that are forbidden by default: Posting a code snippet instead of a complete answer
However, mixing up the discussion and voting with the program/function debate seems to be causing confusion, so I thought this could use its own question.