Hi,

I have an exported template which is logically should be called only as a top 
level statement in other modules. If it is incidentally called inside a proc it 
breaks thread safety (template changes global var). And this is multithreaded 
application, nim code is single threaded but wrapping C project is 
multithreaded.

I would like to enforce the contract with somehing like:
    
    
    when not isTopLevel:
      {.error: "Template should be invoked only from top level"}
    

Any ideas how similar can be achieved?

Thanks 

Reply via email to