Are comp a ModelInstance or is it a pointer to a ModelInstance? In C the "->" 
operator takes a pointer to a struct and the field we want and then 
dereferences it. The equivalent Nim code in that case is: 
    
    
    template r(vr: untyped): untyped = comp[].r[vr]
    
    
    Run

And if you want to write it like in the C code this template does it: 
    
    
    template `->`(s, f: untyped): untyped = s[].f
    
    
    Run

Then the template becomes: 
    
    
    template r(vr: untyped): untyped = comp->r[vr]
    
    
    Run

Reply via email to