Hi -

What version of Chapel are you using? The following
program compiles and runs for me with 1.20, 1.21, and 1.22.
Could you show the code calling `dot` as well and the error?

proc dot(const ref a : [?asize] ?T, ref b :[asize] T) : T 
{ 
  var s = 0.0:T;

  for (ai, bi) in zip(a, b) do
  {
    s += ai * bi;
  }
  return s;
} 

var A:[1..10] int;
var B:[1..10] int;

writeln(dot(A, B));

Thanks,

-michael

    
    Hi,
    
    The following compiles:
    
        proc dot(const ref a : [?asize] ? T, ref b :[?bsize] T) : T
        {
                var s = 0.0:T;
    
                for (ai, bi) in zip(a, b) do
                {
                        s += ai * bi;
                }
                return s;
        }
    
    The domain of 'a' and 'b' are the same. So I should be able to write:
    
        proc dot(const ref a : [?asize] ?T, ref b :[asize] T) : T
        {
                var s = 0.0:T;
    
                for (ai, bi) in zip(a, b) do
                {
                        s += ai * bi;
                }
                return s;
        }
    
    Chapel complains vehemently.  Why?
    
    I cannot see what I am doing wrong.
    
    Regards - Damian
    
    Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
    Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
    Views & opinions here are mine and not those of any past or present employer
    
    
    _______________________________________________
    Chapel-developers mailing list
    [email protected]
    https://lists.sourceforge.net/lists/listinfo/chapel-developers 
    


_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to