caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Joel Reymont <joelr1@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: camlp4 3.10: Tuple processing
Date: Mon, 30 Apr 2007 15:34:52 +0100	[thread overview]
Message-ID: <1F2DC9D5-570E-45AF-B355-0B55ACB12C56@gmail.com> (raw)

Looking at Martin's json code I find this example of tuple conversion  
in the old syntax:

       | Tuple l ->
           let tl = List.map convert l in
           <:ctyp< ( $list:tl$ ) >>

In the new syntax the same code becomes something much larger:

       | Tuple l ->
           (* (* Development version post-3.10.0+beta: *)
              let tl = List.map convert l in
              <:ctyp< ( $tup:Ast.tySta_of_list tl$ ) >> *)
           let t =
             List.fold_right
               (fun x tup -> <:ctyp< $convert x$ * $tup$ >>)
               l <:ctyp< >> in
           <:ctyp< $tup:t$ >>

What is the advantage of the new approach and how did it become so  
verbose?

	Thanks, Joel

[1] http://martin.jambon.free.fr/examples/pa_json_static_3100beta.html

--
http://wagerlabs.com/






             reply	other threads:[~2007-04-30 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 14:34 Joel Reymont [this message]
2007-04-30 14:40 ` Joel Reymont

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=1F2DC9D5-570E-45AF-B355-0B55ACB12C56@gmail.com \
    --to=joelr1@gmail.com \
    --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).