Yep, but host and h are both fields of Socket, no? (Perhaps I do not fully 
understand procedural programming for the present, I'm used to OOP only 
defore). Ok, it is works: main.nim: 
    
    
    import InfoModule
    
    var info: Info
    new info
    
    info.level = 5
    echo info.title
    

InfoModule.nim 
    
    
    type
      Info* = ref object of RootObj
        level: int
        title: string
    
    proc `level=`*(info: var Info, value: int) {.inline.} =
      info.level = value
      info.title = "Level " & $(value)
    
    proc `title`*(info: var Info): string {.inline.} =
      info.title
    

Reply via email to