<?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/197f774f49a402a99d05bc8ca55d5c63"
  from="Luc Maranget &lt;luc.maranget@i...&gt;"
  author="Luc Maranget"
  date="2002-12-13T12:27:29"
  subject="Re: [Caml-list] small problem&apos;"
  prev="2002/12/7cb0932659a8073f4d6a11bd152262c9"
  next="2002/12/4858aa5f7e862333458ddb4f16d33639"
  next-in-thread="2002/12/4858aa5f7e862333458ddb4f16d33639"
  prev-thread="2002/12/44df524459f58d9802aeb42be3e7d400"
  next-thread="2002/12/91fe95b70649b64d0cb16758a0b17044"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Re: [Caml-list] small problem&apos;">
<msg 
  url="2002/12/197f774f49a402a99d05bc8ca55d5c63"
  from="Luc Maranget &lt;luc.maranget@i...&gt;"
  author="Luc Maranget"
  date="2002-12-13T12:27:29"
  subject="Re: [Caml-list] small problem&apos;">
<msg 
  url="2002/12/4858aa5f7e862333458ddb4f16d33639"
  from="sebastien FURIC &lt;sebastien.furic@t...&gt;"
  author="sebastien FURIC"
  date="2002-12-13T14:01:33"
  subject="Re: [Caml-list] small problem&apos;">
<msg 
  url="2002/12/519c8998e014161b242ede93d68d76bb"
  from="Sven Luther &lt;luther@d...&gt;"
  author="Sven Luther"
  date="2002-12-13T15:12:38"
  subject="Re: [Caml-list] small problem&apos;">
</msg>
</msg>
</msg>
</thread>

<contents>
&gt; 
&gt; How to omit the syntax error in OCAML in CAML it runs.
&gt; let hd = function
&gt;     [] -&gt; failwith "hd"
&gt;   | a::l -&gt; a;;
&gt;  Characters 2-3:
&gt;     | a::l -&gt; a
&gt;     ^
&gt; Syntax error
&gt; Mit freundlichen Gruessen
&gt; Klaus Benecke

I do not see what is your problem exactly.
If I copy-paste your three lines in ocaml toplevel, I get :

$ ocaml
        Objective Caml version 3.06

# let hd = function
    [] -&gt; failwith "hd"
  | a::l -&gt; a;;
    val hd : 'a list -&gt; 'a = &lt;fun&gt;

--Luc
-------------------
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>

