Tuples as paramters

Andy with Recycled Electrons aba3600@REDACTED
Mon Sep 25 03:10:47 CEST 2000


I've got a newbie question;  What's wrong with this code:

nadd({mean1, variance1, number_samples1},
     {mean2, variance2, number_samples2}) ->	% N1 + N2
	{mean1 + mean2,				% mean
	 variance1 + variance2,			% variance
	 (number_samples1 + number_samples2)/2	% number of samples

It is supposed to take 2 parameters, each a 3-element tuple, and return a
3-element tuple.  It is exported from a module called "poedt" that is
correctly compiled into the Erlang system.

I've tried the following code (run under OTP R6B) with Lists instead of
Tuples, and it worked.  I then changed from Lists to Tuples, and it gives

2> c(poedt).

3> poedt:nadd({1,2,3},{12,11,10}).  

=ERROR REPORT==== 24-Sep-2000::20:08:37 ===
Error in process <0.34.0> with exit value:
** exited: {function_clause,[{poedt,nadd,[{1,2,3},{12,11,10}]},
                             {shell,eval_loop,2}]} **

Thanks in advance for any information you can provide!

Andy Allen
Recycled Electrons
email: andy@REDACTED

More information about the erlang-questions mailing list