You might also wants to do this the [Nim 
way](https://nim-lang.org/docs/manual.html#procedures-properties)
    
    
    proc age(a: Human): int = a.age
    
    proc `age=`(a: var Human, age: int) =
      a.age = age
    
    Frank.age = 99 # or `age=`(Frank, 99)
    echo Frank.age # or age(Frank)
    
    
    Run

Note: if the `age` field can be accessed directly, then Nim will prioritize 
that instead.

Reply via email to