<?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="2003/07/21695e1546cd0d7c3589874712a38466"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-07-04T21:50:11"
  subject="Re: [Caml-list] CDuce"
  prev="2003/07/9265629f02a5161f666b1798bc5cc5e1"
  next="2003/07/6fb9d2897cba518cab99e18cea396c7a"
  prev-in-thread="2003/07/427d93c8bda6d480ea0c18c1c4d5b6ff"
  prev-thread="2003/07/1af2bb59803449d5aba637a7223a6f2a"
  next-thread="2003/07/6d54ebe42cd1491a5c32cf6e278324db"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] CDuce">
<msg 
  url="2003/07/abf5ceeae667fb34e9e077ec470362fb"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-07-04T08:20:20"
  subject="[Caml-list] CDuce">
<msg 
  url="2003/07/427d93c8bda6d480ea0c18c1c4d5b6ff"
  from="Matt Gushee &lt;mgushee@h...&gt;"
  author="Matt Gushee"
  date="2003-07-04T19:37:11"
  subject="Re: [Caml-list] CDuce">
<msg 
  url="2003/07/21695e1546cd0d7c3589874712a38466"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-07-04T21:50:11"
  subject="Re: [Caml-list] CDuce">
</msg>
</msg>
</msg>
</thread>

<contents>
On Fri, 4 Jul 2003, Matt Gushee wrote:

&gt; On Fri, Jul 04, 2003 at 10:20:14AM +0200, Alain.Frisch@ens.fr wrote:
&gt; &gt;
&gt; &gt; I'm pleased to announce the first public release of CDuce, a new
&gt; &gt; strongly typed higher-order functional programming language for XML
&gt; &gt; documents with an efficient type-based runtime implementation.
&gt;
&gt; This is very interesting. I've compiled it and begun learning the language,

Thank you for your interest in CDuce !

&gt; but there seems to be a problem with type inferencing in the 'load_xml'
&gt; function. Given the following XML:
...
&gt; # let abc : ABC = load_xml "abc.xml";;
&gt;
&gt; Have I done something wrong, or is this indeed a bug?

The point is that CDuce programs are statically type-checked. At "compile
time", there is no way to be sure that the result of load_xml will have
type ABC (load_xml operates at runtime), hence the type error. A possible
way to do what you want is:

let abc =
  match load_xml "abc.xml" with
    | x &amp; ABC -&gt; x
    | _ -&gt; raise "Invalid input file !"

The pattern (x &amp; ABC) succeeds when the argument of the pattern matching
(the loaded XML document) has type ABC, and it binds it to x.

&gt; P.S.: Is there any particular reason your makefile doesn't have an
&gt;   ordinary 'install' target, so that people can easily install the
&gt;   tools for command-line use?

No particular reason. A "cp cduce /usr/local/bin" should do the stuff.


I suggest to keep strictly CDuce related discussions out of the Caml-list.
Interested people can send me an email to join the CDuce users mailing
list.


-- Alain

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

