<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/d7f6a535f2b5af686757913f5410d4c3"
  from="Jonathan Roewen &lt;jonathan.roewen@g...&gt;"
  author="Jonathan Roewen"
  date="2006-02-13T02:47:09"
  subject="Re: [Caml-list] HOFs, recursion, and being tail-rec..."
  prev="2006/02/ec0d44ff62d75045f20c72ef969673d9"
  next="2006/02/7671c25a66146a5eacec0fcc2cdb6277"
  prev-in-thread="2006/02/ec0d44ff62d75045f20c72ef969673d9"
  next-in-thread="2006/02/7671c25a66146a5eacec0fcc2cdb6277"
  prev-thread="2006/02/a51f7a8ac5ce6d0b7ddd632d1c82c550"
  next-thread="2006/02/a74b4211ff6f1c1241c93b24e6b20882"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] HOFs, recursion, and being tail-rec...">
<msg 
  url="2006/02/20b9bddf6cd70a75c82f40d837c93956"
  from="Jonathan Roewen &lt;jonathan.roewen@g...&gt;"
  author="Jonathan Roewen"
  date="2006-02-12T22:08:17"
  subject="[Caml-list] HOFs, recursion, and being tail-rec...">
<msg 
  url="2006/02/a45690b88065de88ec908956c5350120"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2006-02-12T23:52:13"
  subject="Re: [Caml-list] HOFs, recursion, and being tail-rec...">
<msg 
  url="2006/02/ec0d44ff62d75045f20c72ef969673d9"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-13T02:05:38"
  subject="Re: [Caml-list] HOFs, recursion, and being tail-rec...">
<msg 
  url="2006/02/d7f6a535f2b5af686757913f5410d4c3"
  from="Jonathan Roewen &lt;jonathan.roewen@g...&gt;"
  author="Jonathan Roewen"
  date="2006-02-13T02:47:09"
  subject="Re: [Caml-list] HOFs, recursion, and being tail-rec...">
<msg 
  url="2006/02/7671c25a66146a5eacec0fcc2cdb6277"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-13T03:23:53"
  subject="Re: [Caml-list] HOFs, recursion, and being tail-rec...">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
&gt; So it isn't a well formed sentence to say depth first
&gt; search cannot be tail-rec, it is easy to construct a
&gt; depth first search in any FPL that is.
&gt;
&gt; However, no matter what you do, you will indeed need
&gt; memory linear in the tree depth (unless it is 1-ary tree as
&gt; pointed out).

Yes, but tail-rec would mean the function call trace does not use
memory linear in the tree depth, which would be a positive
optimisation. BTW: the memory linear to the tree depth is used in the
list passed to search, 'visited'.

I'm just wondering if using List.exists and HOFs prevents the compiler
from generating tail-rec code (I presume that List.exists is already
tail-rec). As it wouldn't be hard to make it tail-rec I'd imagine..

Jonathan

</contents>

</message>

