> Can parseEnum help you with what you want to do?

Thank you for your assistance. At the very end, `{.experimental: 
"dynamicBindSym".}` did the trick for me. I got three different solutions: via 
typedesc, via template (forwarding) and with `bindSym` at compile-time. The 
least mentioned was I was looking for.
    
    
    import macros
    {.experimental: "dynamicBindSym".}
    
    type
      Qa = object
        field: int
      Qb   = array[0..23,NimNode]
      Qc   = tuple[tfa : int, tfb : int, tfc : string]
    
    macro helper(a : typed, acomm : string): untyped =
      echo "helper ",acomm," ", treeRepr getImpl a
    
    macro resolve(ta : typedesc, tb : untyped, tc : untyped) : untyped =
      echo "entry ", ta.strVal, tb.strVal, tc.strVal
      var dyn = strVal tc
      echo "typedesc ", treeRepr getImpl ta
      template tpl(v) = helper v, "forwarded"
      let retv = getAst tpl tb
      let NNode = bindsym dyn
      echo "dyn. bind ", treeRepr getImpl NNode
      result = retv
    
    resolve(Qa,Qb,Qc)
    
    # prints type description in order : Qa, Qc, Qb
    
    echo " done. "
    
    
    
    Run

Reply via email to