Does D have a tool like pySnooper?

Dennis dkorpel at gmail.com
Thu Apr 25 08:44:14 UTC 2019


On Monday, 22 April 2019 at 16:24:53 UTC, Taylor Hillegeist wrote:
> Or would this not be easy at all with D?

I don't think so. While there are lots of traits for 
introspection of declarations, there is no way to introspect 
lines of code. The whole function
would need to be wrapped into a mixin, and the D code would need 
to be parsed
at compile time for this to work.

It could be possible for the compiler to do this, similar to how 
it inserts counter increments every line when compiling with -cov 
for code coverage, but currently it doesn't.


More information about the Digitalmars-d-learn mailing list