caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hongbo Zhang <bobzhang1988@gmail.com>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Some utilities about camlp4
Date: Tue, 21 Feb 2012 08:29:48 -0500	[thread overview]
Message-ID: <4F439C4C.3030000@gmail.com> (raw)
In-Reply-To: <CAPFanBFR_wuxR22-x_wWWy6uEC0N=S+qO1Cnni8L+MG4kRvL0Q@mail.gmail.com>

On 2/21/12 5:22 AM, Gabriel Scherer wrote:
Hi,
> 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.
yes.
> 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.
Yes, so generally you will combined it with INCLUDE like this
module Trash = struct
   INCLUDE "xx.ml"
end
This could avoid linking camlp4 (very big) when you don't need it.
It will find all type definitions in xx.ml(not the last one). It's pretty
easy to mix with other syntax extensions now.
> 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.
the meta_float, meta_int never compiles in the original distribution
>
> 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?
another piece, the original file Camlp4FiltersMetaFilter was quite
unreadable, and impossible to modify according to custom needs(at least
I found it hard to read and modify...)


Thanks
> 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 13:29 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
2012-02-21 13:29   ` Hongbo Zhang [this message]

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=4F439C4C.3030000@gmail.com \
    --to=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    /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).