[erlang-questions] "Symmetrical" function

Richard O'Keefe ok@REDACTED
Mon Feb 16 23:31:17 CET 2009


On 17 Feb 2009, at 10:41 am, Michael Radford wrote:
> But you are supposing that the function is not symmetrical.
> f(a,b) =/= f(b,a).
>
> For functions that are actually symmetrical, as the original poster  
> was
> asking about, either approach should give the same results when either
> the upper or lower half of the matrix of clauses is correctly  
> specified.

There is the function that one *wants* to implement,
and there is the code that has been *written* to implement half
of it.  Michael Radford is assuming that the actually written
code is correct ("is CORRECTLY specified").
I'm not.  Just writing half of the clauses of
a function and then pasting together two suitably adjusted copies
may not give you what you expect.

He is also assuming that one of the halves of the matrix has been
consistently chosen ("either the upper or lower half").  I didn't
say anything in the original message to indicate that this was so.

I don't think we really disagree; it's a theory-vs-practice issue.






More information about the erlang-questions mailing list