Maybe the following is sufficient:
    
    
    proc myProc(a : auto) =
      when a is int: echo "got an int"
      elif a is string: echo "got a string"
      elif a is float: echo "got a float"
    
    proc myProc2(a : int | float | string) = discard
    
    myProc(1)
    myProc("abc")
    myProc(2.0)
    
    
    Run

You can use an object variant if you only know the type at runtime.

Reply via email to