OK, perl6-language is getting scary again ;-)  So here's something else
to think about.  Code coverage.

We don't have to worry about how to do it here.  That's a problem for
internals, and they seem to be solving it quite well without my
interference at the moment, even if they are not aware of that.

But it's often nice to be able to provide information to the coverage
tool which it may not be able to figure out on its own.  In most
coverage tools, this sort of information is bolted onto the language,
usually in the form of special comments.  It would be nice to be able to
design something useful into Perl 6 from the start.

So I would like to see able to tag arbitrary information onto just about
everything, including files, packages, classes, subroutines, blocks,
control structures, statements, lines, expressions, variables and
whatever else I've forgotten about.  Properties can be attached to some
of these.  Can we generalise this at all?

Of course, the applicability of this is not limited to code coverage, so
it would be nice to have something as general and multi purpose as
possible.

The sort of data I'm thinking about includes:

 - this statement should never be executed
 - this class is a singleton
 - these two conditional statements have the same condition
 - the values that this variable can take are constrained by that variable
 - these two subroutines are mutually exclusive - use one or the other

But I don't want language support for saying that, that seems to be a
problem for the applications that want the data, although I'd be glad to
be shown that I am wrong and that the language can support that in a
clean and concise way.  Instead, I just want somewhere to hang arbitrary
data.

Thoughts?

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to