On Thursday, 30 June 2016 at 04:07:03 UTC, Hiemlick Hiemlicker wrote:
Can one use this to hook in to any phobo's lib functions?

Yeah, you could. Easier though is to just copy the phobos lib file, modify it, then compile it into your program explicitly:

cp dmd2/src/phobos/std/file.d .
# edit your local ./file.d to play with it
dmd yourprogram.d your_other_modules.d file.d


notice that I added the copied Phobos file to the compile command line. Then the compiler will prefer the one from your file to the one in Phobos itself. Nothing else needs to change, you still import std.file;

Can we call the original functions somehow?

No, with this technique the linker will remove the original functions from the program.


Reply via email to