<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>Why?
The comparison returns true if:</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>- it's
the *same code*</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>- All
bindings in the two functions are equal</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>-
Otherwise, the functions might still be observably equal,</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>
but that is, as you say, undecidable.</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>I'd
settle for the implemented version of function equality,</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff
size=2>especially since the alternative would be, as you
say,</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>a
runtime error.</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN><SPAN class=805460510-03022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff size=2>But of
course, I'm not an academic.</FONT></SPAN></DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=805460510-03022006><FONT face=Arial color=#0000ff
size=2>/Uffe</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Thomas Johnsson [mailto:thomas@skri.net]
<BR><B>Sent:</B> den 3 februari 2006 10:37<BR><B>To:</B> Ulf Wiger
(AL/EAB)<BR><B>Cc:</B> erlang-questions@erlang.org<BR><B>Subject:</B> Re:
Memoization in Erlang?<BR></FONT><BR></DIV>
<DIV></DIV>Ulf Wiger (AL/EAB) wrote:
<BLOCKQUOTE
cite=midD4ADC896EC3F5948A9D3899986CEB9DE030D674E@esealmw115.eemea.ericsson.se
type="cite"><PRE wrap="">Thomas Johnsson
</PRE>
<BLOCKQUOTE type="cite"><PRE wrap="">What, you can do function equality in Erlang??
I hadn't realized....
</PRE></BLOCKQUOTE><PRE wrap=""><!---->
You mean I actually have to verify my
suggestions before posting them? ;)
I will admit that I just plainly assumed
that it would work. My original suggestion
was to use erlang:fun_info(F) as a key.
</PRE>
<BLOCKQUOTE type="cite"><PRE wrap="">That's highly dubious ... When are two function
equal according the the Erlang implementation?
</PRE></BLOCKQUOTE><PRE wrap=""><!----></PRE></BLOCKQUOTE>My point was that it *shouldn't* work
(:-)<BR>The traditional view is that two function are equal iff for same
arguments they return the same result. <BR>Ie undecidable since the number of
possible arguments is infinite.<BR>In my opinion, in Erlang an attempt to
compare two functions should cause a run time error.<BR><BR>--
Thomas<BR><BR></BLOCKQUOTE></BODY></HTML>