From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=DNS_FROM_RFC_POST,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 221A0BC37 for ; Wed, 30 Sep 2009 15:33:09 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AskBACf7wkrRVd+2mWdsb2JhbACPWIppPwEBAQEBCAsKBxOtT5AEAQMDBYQiBIFNhlA X-IronPort-AV: E=Sophos;i="4.44,480,1249250400"; d="scan'208";a="33869949" Received: from mail-iw0-f182.google.com ([209.85.223.182]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 Sep 2009 15:33:08 +0200 Received: by iwn12 with SMTP id 12so3281644iwn.1 for ; Wed, 30 Sep 2009 06:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=a5LntBC7xTsP89S1lwoaSz3ooqSVVuIG5shdqLxTACc=; b=Ip9vLyv+aBsQ7RI9hpbergWejjNAJq+d2dEbOqF3wx4g6BUqtrWoJlzHVw/mygsCxT ecZ7qr4WpUOJthgAJhp2LF+lHXixiVbQ9suFR9kilt0nFdvdp3ap72XyIEiZI3O8ui97 AIkA4mH7ZQUMOruAXJl9ZwVKRS9A/rimeu3kY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Rwft7RE7I+cu7jmMQbkE1oR4GJp2wznqGKGe7lYFPFcQijwN3e/5vyP2ATENlWKDzR wXHMxJsCANdNC+50+t1pcpdZGg5tTCISgHQB5RJceMqoJzNVuLs5GzKRlRiKLd1V3bxI gJNrJMbukBjrr2yMPJum290eAOTFkrKrZzdqY= MIME-Version: 1.0 Sender: till.varoquaux@gmail.com Received: by 10.231.73.131 with SMTP id q3mr11456999ibj.6.1254317587929; Wed, 30 Sep 2009 06:33:07 -0700 (PDT) In-Reply-To: <20090930125904.GA5126@annexia.org> References: <20090930101622.GA15517@annexia.org> <245077.49646.qm@web111516.mail.gq1.yahoo.com> <20090930115723.GL1104@annexia.org> <20090930125904.GA5126@annexia.org> Date: Wed, 30 Sep 2009 09:33:07 -0400 X-Google-Sender-Auth: d8942cd83d990b3b Message-ID: <9d3ec8300909300633t51db9ed9jf3ad15e6b0551c1e@mail.gmail.com> Subject: Re: [Caml-list] xpath or alternatives From: Till Varoquaux To: Richard Jones Cc: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocamlduce:01 xduce:01 ocaml:01 ocamlduce:01 casts:01 runtime:01 ocaml's:01 0100,:01 cduce:01 compiler:01 beginner's:01 ocaml:01 bug:01 maintainable:98 2009:98 OCamlduce (Alain correct me if I am wrong) basically maintains two separate type systems side by side (the Xduce one and the Ocaml one). This is done in order to make Ocamlduce maintainable by keeping a clear separation. As a result you have to explicitly convert values between type systems using {:...:}. These casts are type safe but do lead to some work at runtime. Also note that ocaml's string are Latin1 and not String in the XML world. S= o: let devs =3D match xml with | {{ [[[]]] }} -> {:dev= :} | {{ [[[]]] }} -> {:file:} in Should work (I'm rusty and have nothing to check handy). Till On Wed, Sep 30, 2009 at 8:59 AM, Richard Jones wrote: > On Wed, Sep 30, 2009 at 12:57:23PM +0100, Richard Jones wrote: >> On Wed, Sep 30, 2009 at 04:05:03AM -0700, Dario Teixeira wrote: >> > Hi, >> > >> > Ocamlduce has been mentioned before in this thread, but I didn't catch >> > the reason why it has been discarded as a solution. =C2=A0Is it becaus= e you >> > don't want to carry the extra (large) dependency, or is there some oth= er >> > reason? >> >> Actually the reason is that I thought it wasn't available for 3.11.1, >> but I just checked the website and it is, and ocamlduce does seem to >> be the obvious solution for this problem. =C2=A0(However I'll need to tr= y >> and see if I can come up with the equivalent code). > > Do any cduce developers want to give me a clue here? =C2=A0It would seem > like I need something along these lines: > > =C2=A0let devs =3D match xml with > =C2=A0 =C2=A0| {{ [[[]]]= }} -> dev > =C2=A0 =C2=A0| {{ [[[]= ]] }} -> file in > > However according to the compiler, devs has type . =C2=A0In any case= , > I think I may need either the map or map* operator, since I want to > match all, not just the first one. > > Rich. > > -- > Richard Jones > Red Hat > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >