<?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/519c8998e014161b242ede93d68d76bb"
  from="Sven Luther &lt;luther@d...&gt;"
  author="Sven Luther"
  date="2002-12-13T15:12:38"
  subject="Re: [Caml-list] small problem&apos;"
  prev="2002/12/4858aa5f7e862333458ddb4f16d33639"
  next="2002/12/bef5070e1bc3ca250bf2f818ad6ff8fa"
  prev-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>
On Fri, Dec 13, 2002 at 03:00:31PM +0100, sebastien FURIC wrote:
&gt; 
&gt; 
&gt; Luc Maranget a écrit :
&gt; &gt; 
&gt; &gt; &gt;
&gt; &gt; &gt; How to omit the syntax error in OCAML in CAML it runs.
&gt; &gt; &gt; let hd = function
&gt; &gt; &gt;     [] -&gt; failwith "hd"
&gt; &gt; &gt;   | a::l -&gt; a;;
&gt; &gt; &gt;  Characters 2-3:
&gt; &gt; &gt;     | a::l -&gt; a
&gt; &gt; &gt;     ^
&gt; &gt; &gt; Syntax error
&gt; &gt; &gt; Mit freundlichen Gruessen
&gt; &gt; &gt; Klaus Benecke
&gt; &gt; 
&gt; &gt; I do not see what is your problem exactly.
&gt; &gt; If I copy-paste your three lines in ocaml toplevel, I get :
&gt; &gt; 
&gt; &gt; $ ocaml
&gt; &gt;         Objective Caml version 3.06
&gt; &gt; 
&gt; &gt; # let hd = function
&gt; &gt;     [] -&gt; failwith "hd"
&gt; &gt;   | a::l -&gt; a;;
&gt; &gt;     val hd : 'a list -&gt; 'a = &lt;fun&gt;
&gt; &gt; 
&gt; &gt; --Luc
&gt; 
&gt;  Luc, you use Linux, don't you ?
&gt;  Under Windows, I have:
&gt; 
&gt;         Objective Caml version 3.06
&gt; 
&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; # 
&gt; 
&gt;  This problem typically comes under Windows when you do a "cut and
&gt; paste" from a text editor to OcamlWin.exe. To overcome this problem, you
&gt; have to copy and paste your function one line at a time.
&gt;  To avoid making myself nervous, I simply never use OCamlWin.exe (or I
&gt; use an older distribution, like the 3.01 one). I prefer to run ocaml in
&gt; a "command" windows (in which case it is possible to cut and paste).

I see, i think it is the trailing character at the end of ligne which
ocaml does not understand.

Friendly,

Sven Luther
-------------------
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>

