From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA32088; Fri, 4 Jul 2003 23:50:11 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA23079 for ; Fri, 4 Jul 2003 23:50:10 +0200 (MET DST) From: Alain.Frisch@ens.fr Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h64Lo9T25445 for ; Fri, 4 Jul 2003 23:50:09 +0200 (MET DST) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h64Lo5ko093696 ; Fri, 4 Jul 2003 23:50:05 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id h64Lo3hr012530 ; Fri, 4 Jul 2003 23:50:03 +0200 (MET DST) X-Authentication-Warning: clipper.ens.fr: frisch owned process doing -bs Date: Fri, 4 Jul 2003 23:50:03 +0200 (MET DST) X-X-Sender: frisch@clipper.ens.fr Reply-To: Alain.Frisch@ens.fr To: Matt Gushee cc: Caml list Subject: Re: [Caml-list] CDuce In-Reply-To: <20030704193710.GA11533@swordfish> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; alain:01 frisch:01 caml-list:01 cduce:01 gushee:01 higher-order:01 type-based:01 runtime:01 bug:01 statically:01 type-checked:01 command-line:01 usr:01 bin:01 0200,:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 4 Jul 2003, Matt Gushee wrote: > On Fri, Jul 04, 2003 at 10:20:14AM +0200, Alain.Frisch@ens.fr wrote: > > > > I'm pleased to announce the first public release of CDuce, a new > > strongly typed higher-order functional programming language for XML > > documents with an efficient type-based runtime implementation. > > This is very interesting. I've compiled it and begun learning the language, Thank you for your interest in CDuce ! > but there seems to be a problem with type inferencing in the 'load_xml' > function. Given the following XML: ... > # let abc : ABC = load_xml "abc.xml";; > > 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 & ABC -> x | _ -> raise "Invalid input file !" The pattern (x & ABC) succeeds when the argument of the pattern matching (the loaded XML document) has type ABC, and it binds it to x. > P.S.: Is there any particular reason your makefile doesn't have an > ordinary 'install' target, so that people can easily install the > 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