Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] CDuce
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] CDuce
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,
but there seems to be a problem with type inferencing in the 'load_xml'
function. Given the following XML:

-- abc.xml -------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<abc>
  <a>aaaa</a>
  <b>bbbb</b>
  <c>cccc</c>
</abc>
------------------------------------------------------------- abc.xml --

My CDuce session looks like this:

        CDuce version 0.1.0

# type ABC = <abc> [ A B C ]
> type A = <a> [ PCDATA ]
> type B = <b> [ PCDATA ]
> type C = <c> [ PCDATA ];;
# let abc : ABC = load_xml "abc.xml";;
Error at chars 16-34:
This expression should have type:
ABC
but its inferred type is:
Any
which is not a subtype, as shown by the sample:
Int


Have I done something wrong, or is this indeed a bug?


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?

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

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