My tiny but useful trace debugging code... Any suggestions from more experienced D users?

WraithGlade wraithglade at protonmail.com
Fri Jun 27 11:12:13 UTC 2025


Oh, and here's another minor update. I've added another `public 
import` line to the module to ensure it actually works correctly 
when imported:

```D
public import std.stdio;
```

Previously I had carelessly omitted this because I was using 
`trace.d` only in contexts where `std.stdio` had already been 
imported, but clearly that would need remedied in the general use 
case.

The `public import`s make the imports visible in the module of 
any module that imports `trace.d`, whereas otherwise such 
necessary dependencies for use wouldn't be visible.

Text based D macros (`string` `mixin`s) can't know their 
dependencies, I'd imagine, hence the reason for adding the two 
imports (of `std.stdio` and `std.conv`).


More information about the Digitalmars-d-learn mailing list