@alexeypetrushin: The following code defines generic `$` making your example 
work
    
    
    proc `$`[T: typed](x: T): string =
      result= "My_$: " & repr(x)
    
    type Unit = ref object
      name: string
    
    echo Unit(name: "Zeratul")
    
    
    Run

Reply via email to