The entirety of the question is:
Is there a language that has a "when" statement that does something whenever a condition becomes true?
That's it. No context, no problem to be solved, no specific requirements for correctness. Just give a language that has a "when" statement as provided to the author.
This is an indiscriminate list, and that's not what Stack Exchange is here for. The point of Stack Exchange is to provide definitive answers that a) solve the problem and b) confer actual knowledge and to have those answers rise to the top via voting.
A question without parameters for correctness is sufficiently vague enough in and of itself to be closed outright. If you're adding anything more than the name of a language (like the long, experience-driven answers we want here), how do you know you're hitting anywhere near the mark?
But the question was given the benefit of the doubt to attract high-quality answers, the existence of which is the essentially the only thing that can save a bad question.
However, a particular up-voted answer on the question received a few flags as "not an answer". When handling those flags, I looked at the other answers to determine what was substantively different from the one that kept getting flagged and the others: I found no difference. Instead, what I found was:
- The (still) top-voted answer is nothing but a link to a Wikipedia article and even mentions the question isn't very clear
- The (still) second top-voted answer is a single line "Nobody's mentioned Intercal's COMEFROM" with no context or added value
- The (still) third-top voted answer answers "yes" and gives an example in Perl.
- Three of the answers are single-line links to Wikipedia articles.
- 13 out of the 17 answers are guesses ("Is X what you're thinking of?" or "Sounds like X, which has Y")
- Of the four that actually provided more than a guess or a Wikipedia article, I found each interpreted the question differently or read different things into the single line of the question:
- One answered a question about the caveats of using a "when"-like statement
- One gave a basic survey of potential equivalents to a "when"-like statement
- One when into detail about a particular potential example and then answered a question about the benefits of AOP
- One answered a question about when you'd want a language to have a "when"-like statement
So what are all the votes for? What the people voting like the most? When every answer is equally valid (or worse, everyone answers a different question) because the question didn't set up any parameters for correctness (like a specific problem to be solved), it renders one of the core aspects of Stack Exchange—community vetting by voting—meaningless. It's a popularity contest: that's what Reddit does, not us.
So I still think the question should be closed: it's a crappy question with no guidance on how to answer it, so crappy, context-free, one-line answers have naturally risen to the top and the answers that aren't crappy are better served on questions they actually answer. A person coming across the question in the future isn't going to learn anything they couldn't have learned from Googling.
But unlike in a tyrannical monarchy, I'm free to voice my dissent with you and the other moderators, just as you're free to make a case for a question to be reopened. If everyone wants to eat cake, that's cool too.