hi, I need to use template to generate objects, example below
    
    
    type
         Person* = object
             name*: string
             job*: string
             email*: string
    
    
    
    Run

I have tried this template, it works, but it only has fixed field.
    
    
    template table(name: untyped, th0, th1, th2: untyped ) =
        type
            `name`* = object
                `th0`*: string
                `th1`*: string
                `th2`*: string
    
    
    table(Person, name, job, email)
    
    
    Run

if I want to have one more field, I need to change my template, is there a 
better way to do it? 

Reply via email to