caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Till Varoquaux <till@pps.jussieu.fr>
To: Richard Jones <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] xpath or alternatives
Date: Wed, 30 Sep 2009 09:33:07 -0400	[thread overview]
Message-ID: <9d3ec8300909300633t51db9ed9jf3ad15e6b0551c1e@mail.gmail.com> (raw)
In-Reply-To: <20090930125904.GA5126@annexia.org>

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. So:

 let devs = match xml with
   | {{ <domain>[<devices>[<source dev=(Latin1 & dev) ..>[]]] }} -> {:dev:}
   | {{ <domain>[<devices>[<source file=(Latin1 & file) ..>[]]] }} ->
{: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 <rich@annexia.org> 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.  Is it because you
>> > don't want to carry the extra (large) dependency, or is there some other
>> > 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.  (However I'll need to try
>> and see if I can come up with the equivalent code).
>
> Do any cduce developers want to give me a clue here?  It would seem
> like I need something along these lines:
>
>  let devs = match xml with
>    | {{ <domain>[<devices>[<source dev=(String & dev) ..>[]]] }} -> dev
>    | {{ <domain>[<devices>[<source file=(String & file) ..>[]]] }} -> file in
>
> However according to the compiler, devs has type <XML>.  In 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
>


  reply	other threads:[~2009-09-30 13:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28 12:17 Richard Jones
2009-09-28 12:48 ` [Caml-list] " Yaron Minsky
2009-09-28 15:06   ` Till Varoquaux
2009-09-29 23:00     ` Mikkel Fahnøe Jørgensen
2009-09-30 10:16       ` Richard Jones
2009-09-30 10:36         ` Sebastien Mondet
2009-09-30 10:49         ` Mikkel Fahnøe Jørgensen
2009-09-30 11:05         ` Dario Teixeira
2009-09-30 11:57           ` Richard Jones
2009-09-30 12:59             ` Richard Jones
2009-09-30 13:33               ` Till Varoquaux [this message]
2009-09-30 14:01                 ` Richard Jones
2009-09-30 14:28                   ` Till Varoquaux
2009-09-30 14:51                   ` Alain Frisch
2009-09-30 15:09                     ` Richard Jones
2009-09-30 15:18                       ` Alain Frisch
2009-10-28  2:22         ` Daniel Bünzli
2009-09-30 13:39 ` Stefano Zacchiroli
2009-09-30 14:49   ` Gerd Stolpmann
2009-09-30 15:12     ` Stefano Zacchiroli
2009-09-30 15:22       ` Jordan Schatz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d3ec8300909300633t51db9ed9jf3ad15e6b0551c1e@mail.gmail.com \
    --to=till@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).