Source code of a method.
Baz
burg.basile at yahoo.com
Mon Nov 4 07:09:37 PST 2013
On Saturday, 26 October 2013 at 16:36:35 UTC, TheFlyingFiddle
wrote:
> Is there a way to extract the source code of a method at
> compiletime?
Yep, at least on win32. (tested in win7 32 with DEP set to "ON"
for everything)
http://dpaste.dzfl.pl/19c77eee
It doesn't run on DPaste (linux x86_64) that's why I restrict the
"yes" to my own local test (on win32).
basically:
- set memory mode for reading code and grab it.
- transform. (in my example I patch a bool as return value).
- set memory mode for writing and patch it with your
"patched-grabed-code".
- call new code.
:)
More information about the Digitalmars-d-learn
mailing list