If type of `a` is really `int`, `float` or `string` you can write code like 
this:
    
    
    proc myProc1(a: int) =
      echo "int: ", a
    
    proc myProc1(a: float) =
      echo "float: ", a
    
    proc myProc1(a: string) =
      echo "string: ", a
    
    proc myProc(a: auto) =
      myProc1(a)
    
    myProc(1)
    myProc(2.0)
    myProc("hello")
    # Passing other than int, float and string result in compile error
    #myProc((3,4))
    
    Run

Or
    
    
    proc myProc(a: int) =
      echo "int: ", a
    
    proc myProc(a: float) =
      echo "float: ", a
    
    proc myProc(a: string) =
      echo "string: ", a
    
    myProc(1)
    myProc(2.0)
    myProc("hello")
    
    Run

But you sad you need to know the type at runtime. That means parameter `a` is 
actually pointer or Any in typeinfo module? 

Reply via email to