Just specialize within one generic function:
    
    
    proc test[T](x: T) =
      when T is seq or T is array:
        for i in x:
          echo i
      else:
        echo x
    
    test(1)
    test([1, 2, 3])
    test(@[4, 5, 6])
    

Reply via email to