A script that acts as a reporter is not always recognized as a reporter.
Instead it is categorized as a command.
I’m referring to scripts whose final (or only) block is report (something)
“Real” commands can’t be mapped, for example, while this hybrid category can:
For an application I’m working on I had to change a test for a reporter into a test for a script, but that’s a broader category and therefore the test is less appropriate.
I call it a bug, from a user point of view.
I’m aware of the subtleties. Proposal: any script that ends with report (…) is a reporter.
And perhaps categories shouldn’t be mutually exclusive.
nope, it's about syntax, not semantics: a reporter is an oval block, in your example it's clearly a puzzle-piece shaped command block. It seems like the problem you're trying to solve is not about syntax.
My "problems", probably those of most users, are hardly ever about syntax, and mostly about semantics. I wonder if a narrow, syntactic definition of is (...) a reporter? aligns with any user's requirements.
Solution This function does what I’ve been looking for:
I’m aware there is no perfect test, as is illustrated by the 4th example (it will wait forever, and never report). It’s a lot more useful though than the built-in is (…) a reporter? !
I changed the category of this topic to “feature request”.
The virtue of the syntactic definition of Reporter is that it's unambiguous. Semantically, custom blocks can behave differently for different inputs. It's not even possible to draw a clear semantic line between Reporters and Predicates, let alone introducing scripts.
(Technically, the syntactic category we call Command should really be called Script; a Command is a single block. But oh well.)