Moritz Lenz wrote:

    $x == 1e5   :ok('the :ok makes this is a test');

I can't help feeling that there's an end-weight problem here: The fact that it is a test is the essence of statement.

If we're thinking of it as a library, then the MMD way of thinking might be appropriate: we know it's an equality test so there's no need to introspect it.

But if we're thinking of it as a core language feature, then using macro semantics -- and introspecting the AST -- isn't necessarily a bad thing.

It also depends on the context. If we're in a file that contains just tests, then there's nothing unexpected about seeing a test. Indeed, the fact that a statement is a test is no longer important (so no end weight issue). But if we want to see these ":ok" tests littering everyday code (i.e. as assertions) then it would be wrong to not make explicit the fact that the statement is a test

Reply via email to