I am trying the following: 
    
    
    proc `·`(v1,v2:tuple[x,y,z:float]):float =
      v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]
    
    
    echo (1.0,2.0,3.0) · (4.0,5.0,6.0)
    
    
    Run

which fails with: 
    
    
    /tmp/a.nim(5, 23) Error: type mismatch: got <(float64, float64, float64)>
    but expected one of:
    proc ·(v1, v2: tuple[x, y, z: float]): float
      first type mismatch at position: 2
      missing parameter: v2
    
    expression: · (4.0, 5.0, 6.0)
    
    
    Run

On the other hand it works if I replace `·` with `*`. So it might have 
something to do with precedence maybe?

In any case, how can I make it work?

Reply via email to