Hi there,

I want to write macros that takes code written in one place and inserts it 
elsewhere. In use this would look something like:
    
    
    registerHook post_foo:
      echo “foo done. x=“, x
    
    ...
    
    proc foo =
      let x = 10
      runHooks post_foo
    
    
    Run

My approach for the `registerHook` macro has been:

  1. create a template from the body passed to `registerHook`. This is easy.
  2. Store a reference to that template so that it is available at compile-time 
to be called by `runHooks`. This is what I’m stuck on.



Is this possible with macros? Any help appreciated.

Reply via email to