caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: bob zhang <bobzhang1988@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Some utilities about camlp4
Date: Tue, 21 Feb 2012 11:22:20 +0100	[thread overview]
Message-ID: <CAPFanBFR_wuxR22-x_wWWy6uEC0N=S+qO1Cnni8L+MG4kRvL0Q@mail.gmail.com> (raw)
In-Reply-To: <CANcqPu5wYpVSTG9hMySjVga_wSy1wZwA3K+LHm9ujRQfpr_ocg@mail.gmail.com>

I had trouble being sure what "meta filter" you were talking about.
Here's what I found out, in case other people on the list wondered the
same: the "meta" part of Camlp4 is about turning a value into a piece
of OCaml AST representing the syntax of this value. The "meta" filter
is a kind of type-conv plugin -- anterior to type-conv -- that reads
the declarations of algebraic datatypes and adds declarations for
functions doing that "meta" work on this datatype, taking values at
this type and returning pieces of Camlp4 AST.

If I understand correctly, here is the change you did -- maybe you
should put this information in a README somewhere:
instead of reading the type declarations in the whole file being
filtered, you only read those contained in a so-called "trash module",
whose name is configurable by the user (default Camlp4Trash). You then
produce declarations for metafunctions on demand, as in the old code,
but you *do not* reproduce the content of the "trash module" -- the
type declarations.

Are there other notable differences between the two implementations?
You said that the upstream one is "buggy", what kind of bugs did you
encounter? It could be interesting to fix them upstream.

It looks like you are doing this new implementation to be able to have
the meta-functions defined in a different module than the original
type declaration. What are the advantages of doing this? Could you
tell us a bit more about your initial motivations?

On Tue, Feb 21, 2012 at 12:58 AM, bob zhang <bobzhang1988@gmail.com> wrote:
> Hi, List
>  the meta filter distributed with camlp4 is buggy and unmodular, I
> put a modular one here
>  http://seas.upenn.edu/~hongboz/meta_filter.zip
>
>  building with syntax extension is really easy provided this file
>  http://www.seas.upenn.edu/~hongboz/myocamlbuild.ml
> It works with .inferred.mli, .pp.ml as well
> --
> Best, bob
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


  reply	other threads:[~2012-02-21 10:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 23:58 bob zhang
2012-02-21 10:22 ` Gabriel Scherer [this message]
2012-02-21 13:29   ` Hongbo Zhang

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='CAPFanBFR_wuxR22-x_wWWy6uEC0N=S+qO1Cnni8L+MG4kRvL0Q@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=bobzhang1988@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).