OK, let me explain what I'm trying to do. Let's say we have a function that 
takes a (ref) object as an argument. Like this:
    
    
    proc myProc(x: MyObj) =
           # do sth
    
    
    Run

and and object like this: 
    
    
    type
          MyObj* = ref object
                case kind*: ObjKind:
                       of typeA          : s: string
                       of typeB          : i: int
    
    
    Run

One way would be to check the object's "kind" from inside the function, like if 
x.kind==typeA:, etc.

The question is: could this be done in any different way, like normal function 
overloading? 

Reply via email to