With the eval/macro interpreter, can I hotpatch new methods into a class at runtime?

Objective C allows this, and it’s incredibly useful for certain esoteric things — for the use case I have in mind, testing. Does the haxe eval/macro runtime allow this kind of run-time system manipulation?

It’s not really exposed (in theory it would be possible though).

You have a bunch of options:

  1. make a (global) build macro that either marks methods of interests (i.e. all?) as dynamic or adds some form of indirection that you can leverage at runtime
  2. try to replace the methods at compile time (if this is about mocking or something, it’s typically feasible)