Simply create the `nnkObjConstr` first, then add your `ColonExpr` nodes to that. Something like this: var myObj = nnkObjConstr.newTree(newIdentNode(strVal(name))) for field in fields: myObj.add newColonExpr(newIdentNode($field[0]), nodeMap(field[1])) Run
- how to use newColonExpr in macro for initializer proc generation jk49
- how to use newColonExpr in macro for initializer proc generati... PMunch