<?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="2002/12/be49727f9a0b54ea11c73a1fa9e19c68"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T20:47:33"
  subject="[Caml-list] Why is (@) written in O&apos;Caml?"
  prev="2002/12/c09fe24875cadf527935c7650ed7fbf5"
  next="2002/12/ae8917859b7799193678c7a51ce64247"
  next-in-thread="2002/12/ec6b4886b2c39dc65c0dac1c458cf870"
  prev-thread="2002/12/e39e48c52e7ed2ec723bb0d96798451f"
  next-thread="2002/12/5601889e766f585d4843a475bbbf5315"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/be49727f9a0b54ea11c73a1fa9e19c68"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T20:47:33"
  subject="[Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/ec6b4886b2c39dc65c0dac1c458cf870"
  from="Pal-Kristian Engstad &lt;engstad@n...&gt;"
  author="Pal-Kristian Engstad"
  date="2002-12-05T21:14:06"
  subject="Re: [Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/df161cd8b28e51dc38f18457ea08df92"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T21:25:02"
  subject="Re: [Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/c4388ecb31fe654b6fb22eeec02a35dc"
  from="Pal-Kristian Engstad &lt;engstad@n...&gt;"
  author="Pal-Kristian Engstad"
  date="2002-12-05T21:53:40"
  subject="Re: [Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/fc6d1c354a67a69a3e554def663ab92b"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T23:28:08"
  subject="Re: [Caml-list] Why is (@) written in O&apos;Caml?">
<msg 
  url="2002/12/d1a700fd99422f1af2c8e0eab4d042a5"
  from="Pal-Kristian Engstad &lt;engstad@n...&gt;"
  author="Pal-Kristian Engstad"
  date="2002-12-05T23:51:02"
  subject="Re: [Caml-list] Why is (@) written in O&apos;Caml?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
let rec (@) l1 l2 =
  match l1 with
    [] -&gt; l2
  | hd :: tl -&gt; hd :: (tl @ l2)

The O'Caml implementation of (@) is recursive and not tail-recursive. All one 
really has to do during "append" is copy l1 and set the last element's CDR to 
l2. I can see why this can not be done in O'Caml itself, but since (@) is 
such a common operation, I'm wondering why it was decided to implement it 
inefficently in O'Caml itself?

Cheers,
Oleg
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

