caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Different types of streams
Date: Wed, 5 Sep 2001 16:01:50 +0200	[thread overview]
Message-ID: <20010905160150.Y5393@verdot.inria.fr> (raw)
In-Reply-To: <200109051256.f85Cuf105667@sarg.ryerson.ca>; from dmason@sarg.ryerson.ca on Wed, Sep 05, 2001 at 08:56:41AM -0400

On Wed, Sep 05, 2001 at 08:56:41AM -0400, Dave Mason wrote:

> You omitted the part of my original email where I said that I honestly
> don't know how easy it is to use this through camlp4o.  If it's
> trivial (i.e. just add ``-pp camlp4o''), I don't understand why it
> won't be the default, and if it's not trivial, I (and several other
> people) will be unhappy.

Camlp4 allows to write pieces of programs in concrete syntax,
representing abstract syntax. I need that for the streams
implementation and optimization.

In my Camlp4 code, I manipulate things like this:
      <:expr< let x = y in z >>

To have the equivalent in OCaml, I should write:
     {pstr_desc =
         Pstr_eval
           {pexp_desc =
              Pexp_let
                (Nonrecursive,
                 [({ppat_desc = Ppat_var "x";
                    ppat_loc =
                      {loc_start = 4; loc_end = 5; log_ghost = false}},
                   {pexp_desc = Pexp_ident (Longident.Lident "y");
                    pexp_loc =
                      {loc_start = 8; loc_end = 9; log_ghost = false}})],
                {pexp_desc = Pexp_ident (Longident.Lident "z");
                 pexp_loc =
                   {loc_start = 13; loc_end = 14; log_ghost = false}});
            pexp_loc =
              {loc_start = 0; loc_end = 14; log_ghost = false}};
       pstr_loc = {loc_start = 0; loc_end = 14; log_ghost = false}}

I don't know for you, but I prefer program with the first form.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-09-05 14:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-26 18:23 Nicolas George
2001-08-27  9:49 ` Daniel de Rauglaudre
2001-08-27 17:47   ` Nicolas George
2001-08-28  8:20     ` Daniel de Rauglaudre
2001-08-28  9:33       ` Nicolas George
2001-08-29  8:39         ` Daniel de Rauglaudre
2001-09-05  1:03   ` Christian RINDERKNECHT
2001-09-05  7:34     ` Daniel de Rauglaudre
2001-09-05  8:02       ` STARYNKEVITCH Basile
2001-09-05  9:10         ` Daniel de Rauglaudre
2001-09-05  9:13         ` Alex Cowie
2001-09-05  9:30           ` Daniel de Rauglaudre
2001-09-05 10:58             ` Dave Mason
2001-09-05 12:06               ` Daniel de Rauglaudre
2001-09-05 12:56                 ` Dave Mason
2001-09-05 14:01                   ` Daniel de Rauglaudre [this message]
2001-09-05 13:29                 ` Nicolas George
2001-09-05 14:30                 ` Patrick M Doane
2001-09-05 14:44                   ` Daniel de Rauglaudre
2001-09-05 14:55                     ` Patrick M Doane
2001-09-05 19:39                     ` Brian Rogoff
2001-09-05 14:49                   ` [Caml-list] Camlp4 and CamlIDL in main distribution? Markus Mottl

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=20010905160150.Y5393@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    /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).